/* GhostRoom Early Access — page styles.
   Ports the inline styles + helmet keyframes from the Claude Design source
   (GhostRoom Early Access.dc.html). Visual primitives (.v3-*) and tokens come
   from the @ghostroom/ds bundle loaded via /_ds/styles.css. */

html, body { margin: 0; background: #0e0f14; }
*::placeholder { color: var(--ink-faint); opacity: 1; }

/* The class display rules below (e.g. .gr-question-step{display:flex}) would
   otherwise override the `hidden` attribute, since author rules beat the UA
   [hidden]{display:none}. Keep hidden elements truly hidden. */
[hidden] { display: none !important; }

@keyframes grFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes grGlow  { 0%, 100% { opacity: .42; transform: scale(1); } 50% { opacity: .7; transform: scale(1.08); } }
@keyframes grNod   { 0% { transform: translateY(0) rotate(0); } 22% { transform: translateY(-5px) rotate(-5deg); } 55% { transform: translateY(-5px) rotate(5deg); } 78% { transform: translateY(-2px) rotate(-2deg); } 100% { transform: translateY(0) rotate(0); } }
/* Entrance keyframes animate transform only — never opacity. If an animation
   ever fails to complete on a display:none -> visible toggle (a known engine
   race), the element is merely offset a few px, never invisible. */
@keyframes grRise  { from { transform: translateY(16px); } to { transform: translateY(0); } }
@keyframes grFade  { from { transform: translateY(8px); } to { transform: translateY(0); } }

/* ---- Camera feed background (ported from app_v3 .v3-stage/.v3-fill-video) ---- */
.gr-cam-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  /* Fallback while the camera loads or if access is denied: the original
     dark gradient. The live feed fades in on top once it's playing. */
  background:
    radial-gradient(120% 70% at 80% -10%, rgba(138,127,176,.18), transparent 60%),
    radial-gradient(90% 55% at -10% 108%, rgba(138,171,151,.1), transparent 55%),
    var(--bg);
}
.gr-fill-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg-deep);
  opacity: 0;
  transition: opacity .6s ease;
}
.gr-fill-video.is-live { opacity: 1; }
.gr-fill-video.is-mirrored { transform: scaleX(-1); }
/* Soft gradient veil so overlaid text always reads against the feed. */
.gr-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(14,15,20,.55), rgba(14,15,20,.32) 30%, rgba(14,15,20,.42) 60%, rgba(14,15,20,.74));
}

/* ---- Root / layout ---- */
.gr-root {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(44px, 12vh, 104px) 22px calc(40px + env(safe-area-inset-bottom, 0px));
  font-family: var(--body);
  color: var(--ink);
  /* Transparent so the camera feed shows through; the .gr-cam-stage layer
     holds the dark gradient fallback. */
  background: transparent;
}
.gr-main {
  width: 100%;
  max-width: 432px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* ---- Brand ---- */
.gr-brand { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.gr-glyph-wrap { position: relative; width: 86px; height: 96px; display: grid; place-items: center; }
.gr-glyph-glow {
  position: absolute; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, var(--accent), transparent 66%);
  filter: blur(12px); animation: grGlow 6.5s ease-in-out infinite;
}
.gr-glyph-float { position: relative; line-height: 0; color: var(--accent); animation: grFloat 6.5s ease-in-out infinite; }
.gr-wordmark {
  font-family: var(--display); font-style: italic; font-weight: 500;
  font-size: 30px; letter-spacing: .01em; line-height: 1; color: var(--ink);
}
.gr-invite-pill { letter-spacing: .16em; font-size: 10.5px; text-transform: uppercase; }

/* ---- Hook ---- */
.gr-hook { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.gr-headline {
  font-family: var(--display); font-style: italic; font-weight: 500;
  font-size: clamp(32px, 8.4vw, 41px); line-height: 1.06; letter-spacing: -.01em;
  margin: 0; color: #fff; text-wrap: balance; max-width: 16ch;
}
.gr-tagline {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65; letter-spacing: .02em;
  margin: 0; color: var(--ink-soft); max-width: 32ch;
}

/* ---- Form panel ---- */
.gr-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sheet);
  box-shadow: var(--sh-soft); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding: 22px;
}
.gr-email-step { display: flex; flex-direction: column; gap: 14px; }
.gr-field-label {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-faint);
}
.gr-input {
  width: 100%; box-sizing: border-box; font-family: var(--body); color: var(--ink);
  background: rgba(236,238,244,0.045); border: 1px solid var(--line); border-radius: var(--r-tile);
  outline: none; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.gr-input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(138,127,176,.26);
  background: rgba(236,238,244,0.07);
}
.gr-input-lg { font-size: 17px; line-height: 1.2; padding: 17px 16px; }
.gr-input-else { font-size: 15px; padding: 13px 14px; }
#gr-link { font-size: 16px; padding: 15px 16px; }
.gr-error { font-family: var(--mono); font-size: 11px; letter-spacing: .02em; color: var(--rec); }
.gr-submit { min-height: 54px; font-size: 13px; }
.gr-email-step .gr-submit { margin-top: 2px; }

/* Consent / privacy note shown directly above the submit button. */
.gr-consent-note {
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
  letter-spacing: .02em;
  color: var(--ink-faint);
}
.gr-consent-note a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.gr-consent-note a:hover { color: var(--ink); }

/* ---- Step 2 — questions ---- */
.gr-question-step { display: flex; flex-direction: column; gap: 22px; }
.gr-signedin { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gr-signedin-pill { color: var(--ink); max-width: 78%; }
.gr-check { color: var(--accent-2); }
.gr-edit-btn {
  flex: none; background: none; border: 0; padding: 4px 2px; color: var(--ink-faint);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-decoration: underline;
  text-underline-offset: 2px; cursor: pointer;
}
.gr-questions-form { display: flex; flex-direction: column; gap: 22px; }
.gr-fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 13px; }
.gr-legend {
  font-family: var(--display); font-style: italic; font-weight: 500; font-size: 22px;
  line-height: 1.15; color: var(--ink); padding: 0; margin: 0;
}
.gr-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
/* Chips reuse .v3-cbtn but must wrap as multi-line cards (DS CBtn is nowrap). */
.gr-chips .v3-cbtn {
  min-height: 56px; text-align: center; white-space: normal; line-height: 1.22;
  padding: 12px 10px; font-size: 11.5px;
}
.gr-link-group { display: flex; flex-direction: column; gap: 11px; }
.gr-hint { font-family: var(--mono); font-size: 10px; letter-spacing: .03em; color: var(--ink-faint); }

/* ---- Footer / colophon ---- */
.gr-colophon {
  margin-top: 30px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-align: center;
}
.gr-colophon a { color: var(--ink-faint); text-decoration: none; }
.gr-colophon a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.gr-colophon .gr-colophon-sep { color: var(--line); margin: 0 8px; }
.gr-colophon .gr-colophon-slash { color: var(--line); margin: 0 5px; }

/* ---- Confirmation ---- */
.gr-done { z-index: 50; }

/* ---- Share sheet ---- */
/* Confirmation (.gr-done) is z-index:50; the share overlay opens from it, so it
   must sit above (the DS default .v3-sheet-overlay z-index is only 40). */
#gr-share-sheet { z-index: 60; }
.gr-share-lead { font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 2px; }
.gr-share-close { margin-top: 4px; }

/* Entrance animations are applied as modifier classes AFTER the element is
   revealed and a reflow forced (see page.js). Applying them on display:flip
   can strand the element at the from-keyframe (opacity:0) in some engines.
   Steady state (no class) is always fully visible. */
.gr-rise-in { animation: grRise .5s cubic-bezier(.2,.7,.2,1); }
.gr-fade-in { animation: grFade .4s ease; }
.gr-done-glyph { border: 0; width: auto; height: auto; line-height: 0; color: var(--accent); }
.gr-nod { display: inline-block; filter: drop-shadow(0 6px 22px rgba(138,127,176,.5)); animation: grNod 3.4s ease-in-out infinite; }
.gr-done-body { max-width: 36ch; }

@media (prefers-reduced-motion: reduce) {
  .gr-glyph-glow, .gr-glyph-float, .gr-nod,
  .gr-rise-in, .gr-fade-in { animation: none; }
}
