/* ============================================================
   Entry gate (Developer Handoff R1, Rev 2) — the layer over every page.

   Render-blocking in <head> and opaque, so the first frame of any page is
   the gate, never the page under it. The world is the site's own: void
   ground with the jade light falling from above, a slate panel on a
   hairline, Manrope 800 for the line that matters, Plex Mono only for the
   field label and the legal line. Every token has its value as a fallback,
   because a 404 deep in a path cannot reach tokens.css by its relative URL.
   ============================================================ */

/* The inline script in <head> decides before anything paints. */
.ib-gate-ok .eg{ display:none !important; }
html.ib-gate-on, html.ib-gate-on body{ overflow:hidden !important; }

.eg{
  position:fixed; inset:0; z-index:2147483000;
  overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
  display:flex; flex-direction:column; align-items:center;
  padding: clamp(16px, 5vh, 64px) 16px;
  color: var(--ink, #F4F1E9);
  font-family: var(--sans, "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif);
  font-size: var(--t-body, 1.0625rem); line-height:1.62; letter-spacing: var(--track-body, -.004em);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(70% 46% at 50% 0%, rgba(23,201,125,.11), transparent 72%),
    radial-gradient(120% 90% at 50% 120%, rgba(3,11,8,.9), transparent 60%),
    var(--void, #05100C);
}
.eg *,.eg *::before,.eg *::after{ box-sizing:border-box; }

.eg-panel{
  position:relative; margin:auto 0;              /* centred when it fits, scrolls from the top when it doesn't */
  width:100%; max-width:31rem;
  background: linear-gradient(180deg, var(--slate, #0E211A), var(--pitch, #081711));
  border:1px solid var(--slate-lift, #163026); border-radius:5px;
  padding: clamp(26px, 6vw, 44px);
  box-shadow: var(--shadow-lg, 0 70px 140px -56px rgba(0,0,0,.9));
}
/* Gold only ever as a hairline: one across the top edge of the panel. */
.eg-panel::before{
  content:""; position:absolute; left:clamp(26px, 6vw, 44px); right:clamp(26px, 6vw, 44px); top:-1px; height:1px;
  background: linear-gradient(90deg, transparent, var(--gold-line, rgba(200,164,84,.30)) 18%, var(--gold, #B08D3A) 50%, var(--gold-line, rgba(200,164,84,.30)) 82%, transparent);
}

/* GATE-01: the header's lockup, mark and wordmark. */
.eg-brand{ display:flex; align-items:center; gap:11px; }
.eg-brand img{ width:auto; height:34px; display:block; flex:none; filter: drop-shadow(0 2px 8px rgba(0,0,0,.55)); }
.eg-brand span{
  font-family: var(--display, "Manrope", sans-serif); font-size:1.34rem; font-weight:800;
  letter-spacing:.04em; line-height:1; text-transform:uppercase; color: var(--ink, #F4F1E9);
}
.eg-brand small{
  display:block; font-family: var(--mono, "IBM Plex Mono", ui-monospace, monospace); font-size: var(--t-nano, .75rem);
  font-weight:500; letter-spacing:.4em; color: var(--ink-faint, #86948D); margin-top:4px;
}

.eg-title{
  font-family: var(--display, "Manrope", sans-serif); font-weight:800;
  font-size: clamp(2rem, 7vw, 2.6rem); line-height:1.06; letter-spacing: var(--track-head, -.022em);
  color: var(--ink, #F4F1E9); margin: clamp(30px, 6vw, 40px) 0 0; text-wrap:balance; outline:none;
}
.eg-body{ margin:14px 0 0; font-size:1rem; line-height:1.6; color: var(--ink-soft, #C8D2CB); max-width:40ch; }

/* GATE-04 */
.eg-field{ display:flex; flex-direction:column; gap:8px; margin-top:30px; }
.eg-field label{
  font-family: var(--mono, "IBM Plex Mono", ui-monospace, monospace); font-size: var(--t-micro, .8125rem); font-weight:500;
  letter-spacing:.14em; text-transform:uppercase; color: var(--ink-mid, #9BA9A2);
}
.eg-field select{
  -webkit-appearance:none; appearance:none; width:100%; min-height:50px; cursor:pointer;
  font-family: var(--sans, "Manrope", sans-serif); font-size:1rem; color: var(--bone, #F4F1E9);
  background: rgba(0,0,0,.28) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23C8D2CB' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center / 12px 8px;
  border:1px solid var(--slate-lift, #163026); border-radius:3px; padding:13px 44px 13px 14px;
  transition: border-color .35s var(--ease-out, ease), background-color .35s var(--ease-out, ease);
}
.eg-field select.is-empty{ color: var(--ink-mid, #9BA9A2); }
.eg-field select option{ background: var(--pitch, #081711); color: var(--bone, #F4F1E9); }
.eg-field select:focus{ outline:none; border-color: var(--jade-bright, #17C97D); background-color: rgba(0,0,0,.42); }
.eg-field select:focus-visible{ box-shadow: 0 0 0 3px rgba(23,201,125,.22); }
@media (hover:hover) and (pointer:fine){
  .eg-field select:hover{ border-color: #24473A; }
}

/* GATE-05, -06, -11 */
.eg-checks{ margin-top:22px; display:grid; gap:14px; }
.eg-check{
  display:flex; align-items:flex-start; gap:12px; cursor:pointer;
  font-size:.9375rem; line-height:1.5; color: var(--ink-soft, #C8D2CB);
}
.eg-check input{
  width:18px; height:18px; margin:2px 0 0; flex:none; cursor:pointer;
  accent-color: var(--jade-bright, #17C97D);
}
.eg-check input:focus-visible{ outline:2px solid var(--jade-bright, #17C97D); outline-offset:3px; }
.eg-check a{ color: var(--ink, #F4F1E9); text-decoration:underline; text-underline-offset:3px; text-decoration-color: rgba(244,241,233,.4); }

/* GATE-07 — the site's bone pill. Disabled reads as not yet, not as broken. */
.eg-enter{
  display:flex; align-items:center; justify-content:center; width:100%; margin-top:30px; min-height:52px;
  font-family: var(--sans, "Manrope", sans-serif); font-size:.9375rem; font-weight:700; letter-spacing:-.005em;
  padding:15px 28px; border-radius: var(--radius-pill, 999px); border:1px solid transparent; cursor:pointer;
  background: var(--bone, #F4F1E9); color: var(--ink-invert, #0B0D0C);
  transition: background-color .4s var(--ease-out, ease), color .4s var(--ease-out, ease),
              border-color .4s var(--ease-out, ease), box-shadow .4s var(--ease-out, ease);
}
.eg-enter:focus-visible{ outline:2px solid var(--jade-bright, #17C97D); outline-offset:3px; }
@media (hover:hover) and (pointer:fine){
  .eg-enter:not(:disabled):hover{ background:#fff; box-shadow: 0 0 0 1px var(--gold-line, rgba(200,164,84,.30)), var(--shadow-sm, 0 8px 22px -12px rgba(0,0,0,.7)); }
}
.eg-enter:not(:disabled):active{ transform: scale(.985); }
/* Disabled still reads as the main action — the site's ghost family —
   just not yet live; the leave link below must never out-shout it. */
.eg-enter:disabled{
  cursor:not-allowed; background: rgba(244,241,233,.08); color: var(--ink-soft, #C8D2CB);
  border-color: rgba(244,241,233,.16);
}

/* GATE-08 and the Go back link in GATE-10 */
.eg-leave{
  display:block; margin:20px auto 0; padding:6px 4px; cursor:pointer;
  font-family: var(--sans, "Manrope", sans-serif); font-size:.9375rem; font-weight:600; letter-spacing:-.004em;
  color: var(--ink-faint, #86948D); background:none; border:0;
  text-decoration:underline; text-underline-offset:4px; text-decoration-thickness:1px;
  text-decoration-color: rgba(134,148,141,.35);
  transition: color .35s var(--ease-out, ease), text-decoration-color .35s var(--ease-out, ease);
}
.eg-leave:focus-visible{ outline:2px solid var(--jade-bright, #17C97D); outline-offset:3px; border-radius:2px; }
@media (hover:hover) and (pointer:fine){
  .eg-leave:hover{ color: var(--ink, #F4F1E9); text-decoration-color: currentColor; }
}

/* GATE-09 — the legal line, in the site's legal voice. */
.eg-fine{
  margin:28px 0 0; padding-top:20px; border-top:1px solid var(--slate-lift, #163026);
  font-family: var(--mono, "IBM Plex Mono", ui-monospace, monospace); font-size: var(--t-micro, .8125rem);
  letter-spacing:.04em; line-height:1.7; color: var(--ink-faint, #86948D);
}

/* GATE-10 */
.eg-left{ text-align:left; }
.eg-left .eg-leave{ margin:22px 0 0; padding-left:0; }

@media (max-width:420px){
  .eg-brand img{ height:28px; }
  .eg-brand span{ font-size:1.16rem; }
}
/* Short screens (a phone on its side): less air everywhere. */
@media (max-height:520px){
  .eg{ padding-block:10px; }
  .eg-panel{ padding:20px 24px; }
  .eg-panel::before{ left:24px; right:24px; }
  .eg-brand img{ height:26px; }
  .eg-brand span{ font-size:1.1rem; }
  .eg-title{ font-size:1.75rem; margin-top:14px; }
  .eg-body{ font-size:.9375rem; margin-top:8px; }
  .eg-field{ margin-top:16px; }
  .eg-checks{ margin-top:14px; gap:10px; }
  .eg-enter{ margin-top:18px; }
  .eg-leave{ margin-top:12px; }
  .eg-fine{ margin-top:18px; padding-top:14px; }
}
/* Wide enough for two columns: the statement on the left, the questions
   and Enter on the right, so all of it is on the first screen. */
@media (max-height:520px) and (min-width:600px){
  .eg-panel{ max-width:48rem; }
  .eg-form{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); column-gap:36px; align-items:start; }
  .eg-intro{ grid-column:1; }
  .eg-controls{ grid-column:2; }
  .eg-controls .eg-field{ margin-top:14px; }
  .eg-fine{ grid-column:1 / -1; }
}
/* Too narrow for two columns and too short for one: Enter rides the
   bottom of the panel's scroll, on a solid band so nothing shows through. */
@media (max-height:520px) and (max-width:599px){
  .eg-enter{ position:sticky; bottom:10px; z-index:1;
    box-shadow: 0 0 0 10px var(--pitch, #081711), 0 -18px 18px -2px var(--pitch, #081711); }
  .eg-enter:disabled{ background:#1B2822; }
}

/* One moment: the panel settles into place. It starts visible — only the
   last few pixels of travel are animated — so nothing waits on it. */
@media (prefers-reduced-motion: no-preference){
  .eg-panel{ animation: eg-settle .9s cubic-bezier(.16,1,.3,1) both; }
  @keyframes eg-settle{ from{ transform: translateY(10px); } to{ transform:none; } }
}
