/* First arrival, owner entry, and the future-facing public threshold. */

#topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.owner-login-button {
  display: inline-flex;
  min-height: 34px;
  padding: 7px 11px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 209, 102, .2);
  border-radius: 18px;
  color: var(--dim);
  background: rgba(13, 14, 26, .78);
  backdrop-filter: blur(8px);
}

.owner-login-button span { color: var(--gold); font-size: 12px; }
.owner-login-button b { font-size: 8px; letter-spacing: .14em; }
.owner-login-button:hover { color: var(--gold); border-color: rgba(255, 209, 102, .48); background: rgba(25, 23, 39, .94); }
.owner-login-button.authenticated { color: #a8e8c0; border-color: rgba(126, 226, 168, .28); }
.owner-login-button.authenticated span { color: #7ee2a8; }

.threshold {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  padding: clamp(70px, 8vh, 110px) clamp(24px, 5vw, 84px) 28px;
  flex-direction: column;
  overflow: auto;
  color: #f1eee4;
  background:
    linear-gradient(90deg, rgba(4, 5, 14, .97) 0%, rgba(5, 6, 16, .91) 45%, rgba(5, 6, 16, .72) 100%),
    radial-gradient(circle at 76% 40%, rgba(255, 209, 102, .12), transparent 25rem);
  backdrop-filter: blur(7px);
  transition: opacity 550ms ease, visibility 550ms ease, transform 550ms ease;
}

.threshold::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 85%, rgba(255, 122, 69, .13), transparent 28rem),
    linear-gradient(110deg, transparent 44%, rgba(255, 209, 102, .04) 44.1%, transparent 44.4%);
}

.threshold-pending {
  visibility: hidden;
  opacity: 0;
  transform: scale(1.015);
}

.threshold-ready {
  visibility: visible;
  opacity: 1;
  transform: none;
}

.threshold-leaving {
  visibility: hidden;
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

.threshold-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .26;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.55) 0 .8px, transparent .9px),
    radial-gradient(circle, rgba(255,209,102,.4) 0 .7px, transparent .8px);
  background-position: 0 0, 57px 37px;
  background-size: 97px 103px, 131px 137px;
  mask-image: linear-gradient(to right, rgba(0,0,0,.2), #000);
}

.threshold-skip {
  position: fixed;
  top: 22px;
  right: 27px;
  z-index: 2;
  padding: 8px 11px;
  border: 0;
  color: rgba(232, 230, 223, .62);
  background: transparent;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.threshold-skip span { margin-left: 5px; color: var(--gold); }
.threshold-skip:hover { color: var(--ink); }

.threshold-stage {
  display: grid;
  width: min(1510px, 100%);
  margin: auto;
  grid-template-columns: minmax(0, 1.22fr) minmax(330px, .68fr);
  gap: clamp(38px, 7vw, 116px);
  align-items: center;
}

.threshold-copy {
  max-width: 900px;
  animation: threshold-rise 900ms 180ms cubic-bezier(.2,.72,.2,1) both;
}

.threshold-kicker {
  display: flex;
  margin: 0 0 18px;
  align-items: center;
  gap: 10px;
  color: #e9bf61;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .22em;
}

.threshold-kicker span {
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, var(--ember), var(--gold));
  box-shadow: 0 0 8px rgba(255, 209, 102, .5);
}

.threshold h1 {
  max-width: 880px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(48px, 6.7vw, 100px);
  font-weight: 400;
  line-height: .94;
  letter-spacing: -.045em;
  text-wrap: balance;
  text-shadow: 0 10px 40px rgba(0,0,0,.45);
}

.threshold-summary {
  max-width: 780px;
  margin: 25px 0 0;
  color: rgba(232, 230, 223, .72);
  font-family: var(--serif);
  font-size: clamp(14px, 1.3vw, 18px);
  line-height: 1.68;
}

.threshold-metrics {
  display: flex;
  gap: clamp(22px, 4vw, 54px);
  margin-top: 28px;
  padding-top: 19px;
  border-top: 1px solid rgba(255,255,255,.09);
}

.threshold-metrics div { position: relative; }
.threshold-metrics div + div::before { position: absolute; top: 4px; bottom: 4px; left: calc(clamp(22px, 4vw, 54px) / -2); width: 1px; content: ""; background: rgba(255,255,255,.08); }
.threshold-metrics b, .threshold-metrics small { display: block; }
.threshold-metrics b { color: #f8e8ba; font-family: var(--serif); font-size: clamp(22px, 2vw, 30px); font-weight: 400; line-height: 1; }
.threshold-metrics small { margin-top: 5px; color: rgba(232,230,223,.42); font-size: 8px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }

.threshold-actions {
  display: flex;
  gap: 11px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.threshold-actions button {
  display: inline-flex;
  min-height: 48px;
  padding: 11px 18px;
  align-items: center;
  gap: 15px;
  border-radius: 25px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .03em;
}

.threshold-primary {
  border: 1px solid rgba(255, 209, 102, .8);
  color: #171019;
  background: linear-gradient(135deg, #ffe6a0, var(--gold));
  box-shadow: 0 9px 32px rgba(255, 209, 102, .14);
}

.threshold-primary span { font-size: 15px; }
.threshold-primary:hover { filter: brightness(1.07); box-shadow: 0 12px 38px rgba(255,209,102,.22); transform: translateY(-2px); }

.threshold-secondary {
  border: 1px solid rgba(255,255,255,.13);
  color: var(--ink);
  background: rgba(255,255,255,.045);
}

.threshold-secondary span { color: var(--gold); }
.threshold-secondary:hover { border-color: rgba(255,209,102,.35); background: rgba(255,209,102,.07); }

.threshold-prompts {
  display: flex;
  gap: 7px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.threshold-prompts button {
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  color: rgba(232,230,223,.5);
  background: rgba(255,255,255,.018);
  font-size: 8.5px;
}

.threshold-prompts button:hover { color: var(--gold); border-color: rgba(255,209,102,.3); background: rgba(255,209,102,.05); }

.threshold-voice {
  position: relative;
  display: grid;
  padding: clamp(24px, 3vw, 38px);
  overflow: hidden;
  border: 1px solid rgba(255,209,102,.19);
  border-radius: 28px 28px 8px 28px;
  background:
    radial-gradient(circle at 90% 0%, rgba(255,209,102,.11), transparent 17rem),
    linear-gradient(145deg, rgba(26, 25, 47, .88), rgba(12, 13, 27, .82));
  box-shadow: 0 30px 90px rgba(0,0,0,.42);
  backdrop-filter: blur(16px);
  animation: threshold-rise 900ms 340ms cubic-bezier(.2,.72,.2,1) both;
}

.threshold-voice::after {
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(255,209,102,.08);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 30px rgba(255,209,102,.02), 0 0 0 64px rgba(255,209,102,.015);
}

.threshold-portrait {
  position: relative;
  display: grid;
  width: 78px;
  height: 78px;
  margin-bottom: 22px;
  place-items: center;
  border: 1px solid rgba(255,209,102,.35);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,209,102,.13), transparent 66%);
  box-shadow: 0 0 0 9px rgba(255,209,102,.025), 0 0 34px rgba(255,209,102,.1);
}

.threshold-portrait span { color: var(--gold); font-family: var(--serif); font-size: 30px; }
.threshold-portrait i { position: absolute; right: -22px; width: 2px; border-radius: 2px; background: var(--gold); opacity: .6; animation: threshold-wave 1.6s ease-in-out infinite; }
.threshold-portrait i:nth-of-type(1) { height: 9px; }
.threshold-portrait i:nth-of-type(2) { right: -29px; height: 18px; animation-delay: 180ms; }
.threshold-portrait i:nth-of-type(3) { right: -36px; height: 12px; animation-delay: 360ms; }

.threshold-voice-label { margin: 0 0 10px; color: var(--gold); font-size: 8px; font-weight: 800; letter-spacing: .2em; }
.threshold-voice blockquote { margin: 0; color: #e8e3d7; font-family: var(--serif); font-size: clamp(15px, 1.3vw, 18px); line-height: 1.65; }
.threshold-caveat { margin: 17px 0 0; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.07); color: rgba(232,230,223,.43); font-size: 9px; line-height: 1.55; }

.threshold-era-line {
  position: relative;
  z-index: 1;
  display: grid;
  margin-top: 26px;
  grid-template-columns: auto 1fr auto 1fr auto;
  gap: 7px;
  align-items: center;
  color: rgba(232,230,223,.35);
  font-size: 7px;
  letter-spacing: .1em;
}

.threshold-era-line i { height: 1px; background: linear-gradient(90deg, rgba(255,209,102,.15), rgba(255,209,102,.6)); }
.threshold-era-line b { color: var(--gold); font-size: 7px; font-weight: 750; }

.threshold-footer {
  display: flex;
  width: min(1510px, 100%);
  margin: clamp(25px, 5vh, 58px) auto 0;
  padding-top: 15px;
  gap: 20px;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,.07);
  color: rgba(232,230,223,.3);
  font-size: 8px;
}

.threshold-footer button {
  padding: 0;
  border: 0;
  color: rgba(232,230,223,.58);
  background: transparent;
  font-size: 8px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.threshold-footer button:hover { color: var(--gold); }
.threshold-footer span { margin-left: auto; text-align: right; }

.owner-login-modal {
  width: min(430px, calc(100vw - 28px));
  padding: 34px;
  overflow: visible;
  border-color: rgba(255,209,102,.25);
  background:
    radial-gradient(circle at 50% 0%, rgba(255,209,102,.1), transparent 16rem),
    rgba(13,14,28,.98);
}

.login-mark {
  display: grid;
  width: 70px;
  height: 70px;
  margin: 0 auto 18px;
  place-items: center;
  border: 1px solid rgba(255,209,102,.35);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(255,209,102,.05);
  box-shadow: 0 0 0 9px rgba(255,209,102,.02), 0 0 32px rgba(255,209,102,.1);
  font-family: var(--serif);
  font-size: 28px;
}

.login-kicker { margin: 0 0 4px; color: var(--gold); font-size: 8px; font-weight: 800; letter-spacing: .2em; text-align: center; }
.owner-login-modal h2 { margin: 0; text-align: center; }
.owner-login-modal .modal-sub { margin: 8px 0 22px; text-align: center; }
.owner-login-modal form { display: grid; gap: 13px; }
.owner-login-modal label { display: grid; gap: 6px; color: var(--dim); font-size: 9px; font-weight: 650; letter-spacing: .05em; }
.owner-login-modal input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; color: var(--ink); background: rgba(5,6,14,.7); outline: none; }
.owner-login-modal input:focus { border-color: rgba(255,209,102,.55); box-shadow: 0 0 0 4px rgba(255,209,102,.08); }
.owner-login-modal button[type="submit"] { min-height: 45px; margin-top: 3px; border: 1px solid rgba(255,209,102,.7); border-radius: 22px; color: #171019; background: linear-gradient(135deg, #ffe49a, var(--gold)); font-weight: 750; }
#login-status { min-height: 18px; margin: 0; color: #ffadad; font-size: 9px; text-align: center; }

.about-lede { color: #f1e6c8; font-family: var(--serif); font-size: 19px; line-height: 1.55; }
.about-covenant { margin: 18px 0; padding: 17px; border: 1px solid rgba(255,209,102,.22); border-radius: 12px; background: rgba(255,209,102,.045); }
.about-covenant h4 { margin-top: 0 !important; }

@keyframes threshold-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes threshold-wave {
  0%, 100% { transform: scaleY(.55); opacity: .35; }
  50% { transform: scaleY(1.25); opacity: .85; }
}

@media (max-width: 980px) {
  .threshold { padding: 76px 28px 25px; }
  .threshold-stage { grid-template-columns: 1fr; gap: 28px; }
  .threshold-copy { max-width: none; }
  .threshold h1 { max-width: 760px; }
  .threshold-voice { grid-template-columns: 80px 1fr; gap: 20px; border-radius: 20px; }
  .threshold-portrait { margin: 0; }
  .threshold-era-line { grid-column: 1 / -1; margin-top: 4px; }
  .threshold-footer { flex-wrap: wrap; }
  .threshold-footer span { width: 100%; margin-left: 0; text-align: left; }
}

@media (max-width: 680px) {
  .owner-login-button { width: 34px; padding: 0; justify-content: center; }
  .owner-login-button b { display: none; }
  .threshold { padding: 64px 18px 20px; background: linear-gradient(180deg, rgba(4,5,14,.96), rgba(5,6,16,.88)); }
  .threshold-skip { top: 13px; right: 12px; }
  .threshold-kicker { margin-bottom: 13px; font-size: 7px; }
  .threshold h1 { font-size: clamp(42px, 14vw, 62px); line-height: .98; }
  .threshold-summary { margin-top: 18px; font-size: 14px; line-height: 1.56; }
  .threshold-metrics { gap: 18px; margin-top: 20px; padding-top: 15px; }
  .threshold-metrics div + div::before { left: -9px; }
  .threshold-metrics b { font-size: 21px; }
  .threshold-metrics small { max-width: 74px; font-size: 6.5px; }
  .threshold-actions { margin-top: 21px; }
  .threshold-actions button { min-height: 45px; padding: 10px 15px; }
  .threshold-prompts { display: grid; grid-template-columns: 1fr; }
  .threshold-prompts button { min-height: 35px; text-align: left; }
  .threshold-voice { display: block; padding: 22px; }
  .threshold-portrait { width: 58px; height: 58px; margin-bottom: 16px; }
  .threshold-portrait span { font-size: 24px; }
  .threshold-voice blockquote { font-size: 14px; }
  .threshold-era-line { display: none; }
  .threshold-footer { display: grid; gap: 10px; margin-top: 22px; }
  .owner-login-modal { padding: 30px 20px 23px; }
}

@media (max-height: 620px) and (min-width: 681px) {
  .threshold { padding-top: 54px; }
  .threshold-stage { align-items: start; }
  .threshold h1 { font-size: clamp(44px, 5.8vw, 72px); }
  .threshold-summary { margin-top: 16px; font-size: 14px; }
  .threshold-metrics, .threshold-actions { margin-top: 17px; }
  .threshold-prompts { display: none; }
  .threshold-voice { padding: 24px; }
  .threshold-portrait { width: 58px; height: 58px; margin-bottom: 14px; }
  .threshold-voice blockquote { font-size: 14px; }
  .threshold-caveat { margin-top: 11px; padding-top: 10px; }
  .threshold-era-line { margin-top: 13px; }
  .threshold-footer { margin-top: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .threshold-copy, .threshold-voice, .threshold-portrait i { animation: none; }
  .threshold { transition-duration: 1ms; }
}
