/* ============================================================================
   SAI external entry (logged-out) - clean + minimal, the Claude/ChatGPT signed-out
   feeling, built entirely on SAI's own design tokens (sai-tokens.css).
   Universal Network Development LLC · UND Industries   [UND-MARKER: SAI-WEB v1]
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Instrument+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

body.sai-entry {
  margin: 0;
  min-height: 100dvh;
  background: var(--sai-bg);
  color: var(--sai-text);
  font: var(--sai-text-md)/var(--sai-leading) var(--sai-font-body);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* a very soft warmth behind everything, so the flat bg isn't clinical (calm, like Claude's cream) */
body.sai-entry::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 45% at 50% 8%, color-mix(in srgb, var(--sai-purple-soft) 40%, transparent), transparent 70%),
    radial-gradient(50% 40% at 85% 100%, color-mix(in srgb, var(--sai-blue-soft) 34%, transparent), transparent 70%);
  opacity: 0.7;
}

/* top bar: wordmark left, quiet auth actions right - exactly like a signed-out app header */
.entry-top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
}
.entry-wm { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--sai-text); }
/* (2026-10-03) the header logo is the shared .sai-logo component (sai-logo.css): no tile behind the S */
.entry-wm .sai-logo { margin-top: 2px; }
.entry-wm .mk svg { width: 17px; height: 17px; fill: none; stroke: var(--sai-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.entry-wm .wmt { font: 600 var(--sai-text-lg)/1 var(--sai-font-body); letter-spacing: var(--sai-tracking-caps); text-transform: uppercase; }
.entry-actions { display: inline-flex; align-items: center; gap: 10px; }

.lnk-quiet {
  padding: 9px 16px; border-radius: var(--sai-radius-pill); text-decoration: none;
  font: 500 var(--sai-text-md) var(--sai-font-body); color: var(--sai-text);
  background: transparent; cursor: pointer;   /* the theme + Private toggles are <button>s: no browser-grey button face */
  border: 1px solid transparent; transition: background var(--sai-motion-fast) var(--sai-ease);
}
button.lnk-quiet { display: inline-flex; align-items: center; gap: 6px; }
.lnk-quiet:hover { background: var(--sai-raised); }
.btn-solid {
  padding: 9px 18px; border-radius: var(--sai-radius-pill); text-decoration: none; cursor: pointer;
  font: 600 var(--sai-text-md) var(--sai-font-body); color: var(--sai-ink-on-soft);
  background: linear-gradient(135deg, var(--sai-blue-soft), var(--sai-purple-soft));
  border: 1px solid transparent; box-shadow: 0 4px 16px rgba(20,28,60,0.14), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform var(--sai-motion-fast) var(--sai-ease), box-shadow var(--sai-motion-fast) var(--sai-ease);
}
.btn-solid:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(20,28,60,0.2), inset 0 1px 0 rgba(255,255,255,0.6); }

/* center stage */
.entry-stage {
  position: relative; z-index: 1; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px 24px 8vh; gap: var(--sai-space-6);
}
.entry-mark { display: grid; place-items: center; }   /* holds the shared .sai-logo; no tile (2026-10-03) */
.entry-mark svg { width: 34px; height: 34px; fill: none; stroke: var(--sai-text); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.entry-h1 {
  font: 600 clamp(30px, 6vw, var(--sai-text-3xl))/1.08 var(--sai-font-display);
  letter-spacing: -0.01em; margin: 0; text-wrap: balance;
}
.entry-sub { margin: 0; max-width: 30ch; color: var(--sai-muted); font-size: var(--sai-text-lg); line-height: 1.5; }

/* the ChatGPT-style single prompt box - typing here invites you to sign in */
.entry-ask {
  width: min(560px, 100%); margin-top: var(--sai-space-2);
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 18px; border-radius: var(--sai-radius-pill);
  background: var(--sai-surface); border: 1px solid var(--sai-line);
  box-shadow: var(--sai-shadow-card);
}
.entry-ask input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  color: var(--sai-text); font: var(--sai-text-md) var(--sai-font-body);
}
.entry-ask button {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: var(--sai-ink-on-soft);
  background: linear-gradient(135deg, var(--sai-blue-soft), var(--sai-purple-soft));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.entry-ask button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.entry-hint { font-size: var(--sai-text-sm); color: var(--sai-muted); min-height: 18px; }
.entry-hint a { color: var(--sai-blue); text-decoration: none; font-weight: 600; }
.entry-hint a:hover { text-decoration: underline; }

/* trust line - sovereign, private, yours (quiet, one row) */
.entry-trust {
  display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px;
  font: 500 var(--sai-text-xs) var(--sai-font-mono); letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--sai-muted);
}
.entry-trust span { display: inline-flex; align-items: center; gap: 7px; }
.entry-trust .d { width: 6px; height: 6px; border-radius: 50%; background: var(--sai-blue); }

.entry-foot {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap;
  padding: 22px; color: var(--sai-muted); font-size: var(--sai-text-sm);
}
.entry-foot a { color: var(--sai-muted); text-decoration: none; }
.entry-foot a:hover { color: var(--sai-text); }

/* phone: every header action stays (Log in too - it used to vanish, leaving a returning visitor no way in), just tighter;
   Private shows as its icon (its title + aria-label say what it is) */
@media (max-width: 480px) {
  .entry-top { padding: 14px 16px; }
  .entry-actions { gap: 4px; }
  .entry-actions .lnk-quiet { padding: 8px 10px; }
  .entry-actions .btn-solid { padding: 8px 14px; }
  .incog-label { display: none; }
}

/* conversation starters (the Perplexity quick-start cards, SAI-flavored) */
.starters { width: min(560px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 2px; }
.starter { text-align: left; display: grid; gap: 3px; padding: 14px 16px; border-radius: var(--sai-radius-md);
  background: var(--sai-surface); border: 1px solid var(--sai-line); color: var(--sai-text); cursor: pointer; text-decoration: none;
  transition: border-color var(--sai-motion-fast) var(--sai-ease), transform var(--sai-motion-fast) var(--sai-ease), box-shadow var(--sai-motion-fast) var(--sai-ease); }
.starter:hover { border-color: var(--sai-blue); transform: translateY(-1px); box-shadow: var(--sai-shadow-card); }
.starter b { font: 600 var(--sai-text-md) var(--sai-font-body); }
.starter small { font-size: var(--sai-text-sm); color: var(--sai-muted); line-height: 1.4; }
@media (max-width: 480px) { .starters { grid-template-columns: 1fr; } }

/* sign-in row - Google one-tap first (surfaces your accounts), email as the quiet alternative */
.auth-row { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(360px, 100%); margin-top: var(--sai-space-2); }
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px 18px;
  border-radius: var(--sai-radius-pill); background: var(--sai-surface); border: 1px solid var(--sai-line); color: var(--sai-text);
  font: 600 var(--sai-text-md) var(--sai-font-body); cursor: pointer; text-decoration: none; box-shadow: var(--sai-shadow-card);
  transition: border-color var(--sai-motion-fast) var(--sai-ease), transform var(--sai-motion-fast) var(--sai-ease); }
.btn-google:hover { border-color: var(--sai-muted); transform: translateY(-1px); }
.btn-google svg { width: 18px; height: 18px; }
.auth-alt { font-size: var(--sai-text-sm); color: var(--sai-muted); }
.auth-alt a { color: var(--sai-blue); text-decoration: none; font-weight: 600; }
.auth-alt a:hover { text-decoration: underline; }

/* cookie policy card, bottom-right (Perplexity pattern) - privacy-preserving default */
.cookie-card { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: min(360px, calc(100vw - 40px)); box-sizing: border-box;   /* padding inside the width: it ran 22px off a phone's left edge */
  padding: 18px 20px; border-radius: var(--sai-radius-lg); background: var(--sai-surface); border: 1px solid var(--sai-line);
  box-shadow: 0 18px 50px rgba(20,28,60,0.22); display: grid; gap: 10px; }
.cookie-card[hidden] { display: none; }
.cookie-head { display: flex; align-items: center; gap: 8px; font: 600 var(--sai-text-md) var(--sai-font-body); }
.cookie-head svg { width: 18px; height: 18px; color: var(--sai-blue); }
.cookie-body { font-size: var(--sai-text-sm); color: var(--sai-muted); line-height: 1.5; }
.cookie-body a { color: var(--sai-blue); text-decoration: none; }
.cookie-actions { display: flex; gap: 8px; justify-content: flex-end; }
.cookie-btn { padding: 8px 16px; border-radius: var(--sai-radius-pill); font: 600 var(--sai-text-sm) var(--sai-font-body);
  cursor: pointer; border: 1px solid var(--sai-line); background: var(--sai-surface); color: var(--sai-text); }
.cookie-btn:hover { background: var(--sai-raised); }
.cookie-btn.primary { background: linear-gradient(135deg, var(--sai-blue-soft), var(--sai-purple-soft)); border-color: transparent; color: var(--sai-ink-on-soft); }

/* Google's own one-tap prompt renders top-right on its own; nothing to style here - it uses Google's card. */

/* ============================================================================
   THE ROBUST CHAT BOX (the composer) - modes dropdown (our version), coming-soon
   pills that shake-deny, model selector, mic, and voice. Perplexity's control
   layout, SAI's skin. Reused on the door and in the app.
   ============================================================================ */
.sai-box { width: min(680px, 100%); display: grid; gap: 0; padding: 8px 8px 6px; border-radius: var(--sai-radius-lg);
  background: var(--sai-surface); border: 1px solid var(--sai-line); box-shadow: var(--sai-shadow-card);
  transition: border-color var(--sai-motion-fast) var(--sai-ease), box-shadow var(--sai-motion-fast) var(--sai-ease); }
.sai-box:focus-within { border-color: color-mix(in srgb, var(--sai-blue) 60%, var(--sai-line)); box-shadow: var(--sai-shadow-card); }
.sai-box-input { resize: none; border: 0; outline: none; background: transparent; color: var(--sai-text);
  font: var(--sai-text-lg)/1.45 var(--sai-font-body); padding: 12px 12px 10px; min-height: 30px; max-height: 168px; }
.sai-box-input::placeholder { color: var(--sai-muted); }
.sai-box-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px; }
.sai-box-left, .sai-box-right { display: flex; align-items: center; gap: 6px; }

.box-icon { position: relative; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--sai-radius-sm); border: 0; background: transparent; color: var(--sai-muted); cursor: pointer;
  transition: background var(--sai-motion-fast) var(--sai-ease), color var(--sai-motion-fast) var(--sai-ease); }
.box-icon:hover { background: var(--sai-raised); color: var(--sai-text); }
.box-icon svg { width: 18px; height: 18px; }
.box-icon.voice { color: var(--sai-ink-on-soft); background: linear-gradient(135deg, var(--sai-blue-soft), var(--sai-purple-soft)); }
.box-icon.voice:hover { filter: brightness(1.04); }

.box-pill { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: var(--sai-radius-pill); border: 1px solid var(--sai-line); background: var(--sai-raised); color: var(--sai-text);
  cursor: pointer; font: 500 var(--sai-text-sm) var(--sai-font-body); white-space: nowrap;
  transition: border-color var(--sai-motion-fast) var(--sai-ease), background var(--sai-motion-fast) var(--sai-ease); }
.box-pill:hover { background: color-mix(in srgb, var(--sai-text) 7%, var(--sai-raised)); border-color: color-mix(in srgb, var(--sai-text) 14%, var(--sai-line)); }
.box-pill svg { width: 15px; height: 15px; }
.box-pill > svg:first-child { opacity: 0.8; }
.box-pill .chev { width: 13px; height: 13px; opacity: 0.55; }
.box-pill.on { border-color: color-mix(in srgb, var(--sai-blue) 45%, var(--sai-line)); background: color-mix(in srgb, var(--sai-blue) 10%, transparent); }
.box-pill.locked { color: var(--sai-muted); }
.box-pill .lock { width: 12px; height: 12px; opacity: 0.7; }
/* phone: the composer row fits (it ran 26px past a 390px screen): Tasks becomes its icon + lock, chevrons go, pills tighten */
@media (max-width: 480px) {
  .box-pill { padding: 0 9px; }
  .box-pill .chev, .box-pill .pill-label { display: none; }
}

/* coming-soon shake-deny */
@keyframes box-shake { 10%,90%{transform:translateX(-1px)} 20%,80%{transform:translateX(2px)} 30%,50%,70%{transform:translateX(-4px)} 40%,60%{transform:translateX(4px)} 100%{transform:none} }
.shake { animation: box-shake 0.42s var(--sai-ease); }
.soon-tip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 5px 10px; border-radius: var(--sai-radius-sm); background: var(--sai-text); color: var(--sai-bg);
  font-size: var(--sai-text-xs); font-weight: 600; pointer-events: none; opacity: 0; transition: opacity var(--sai-motion-fast); z-index: 6; }
.soon-tip.show { opacity: 1; }

/* modes / model dropdown menu */
.box-mode { position: relative; }
.box-menu { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 20; min-width: 230px; display: grid; gap: 2px;
  padding: 6px; border-radius: var(--sai-radius-md); background: var(--sai-surface); border: 1px solid var(--sai-line); box-shadow: var(--sai-glass-shadow); }
.box-menu[hidden] { display: none; }
.box-menu.right { left: auto; right: 0; }
.mode-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border: 0;
  background: transparent; color: var(--sai-text); border-radius: var(--sai-radius-sm); cursor: pointer; font: 500 var(--sai-text-sm) var(--sai-font-body); }
.mode-item:hover { background: var(--sai-raised); }
.mode-item .mi-ic { width: 16px; height: 16px; color: var(--sai-muted); flex: none; }
.mode-item .mi-txt { flex: 1; display: grid; gap: 1px; }
.mode-item .mi-txt small { color: var(--sai-muted); font-size: 11px; font-weight: 400; }
.mode-item .mi-check { width: 15px; height: 15px; color: var(--sai-blue); flex: none; }
.mode-item.locked .mi-txt b { color: var(--sai-muted); }
.mode-item .mi-soon { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 999px;
  background: var(--sai-orange-soft); color: var(--sai-ink-on-soft); flex: none; }
