/* AI Skool Team — luxe gold on charcoal-navy, coral for accents
   Based on brand/skool-scale-camp.md */

:root {
  --bg: #0f1419;
  --surface: #1a2129;
  --surface-2: #232c36;
  --text: #f5ebd0;
  --text-muted: #c6bfae;
  --gold: #d4af37;
  --gold-bright: #e6c873;
  --gold-soft: rgba(212, 175, 55, 0.18);
  --gold-line: rgba(212, 175, 55, 0.35);
  --coral: #ff6b3d;
  --coral-hover: #e85829;
  --green: #7ac74f;
  --danger: #ff7676;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --maxw: 980px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(212, 175, 55, 0.10), transparent 50%),
    radial-gradient(ellipse at 90% 100%, rgba(255, 107, 61, 0.07), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

a { color: var(--gold-bright); text-decoration: none; }
a:hover { color: var(--coral); }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 2rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.25rem; margin: 0 0 0.35rem; }
h3 { font-size: 1rem; margin: 0 0 0.5rem; }

.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ======================== Buttons ======================== */

.btn-primary {
  background: var(--coral);
  color: white;
  border: none;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
  box-shadow: 0 6px 18px rgba(255, 107, 61, 0.25);
}
.btn-primary:hover:not(:disabled) {
  background: var(--coral-hover);
  box-shadow: 0 8px 24px rgba(255, 107, 61, 0.35);
}
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.55; cursor: progress; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--gold-line);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-ghost:hover { border-color: var(--gold-bright); background: var(--gold-soft); }

.link-button {
  background: none;
  border: none;
  color: var(--gold-bright);
  font: inherit;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.link-button:hover { color: var(--coral); }

.pill-btn {
  background: transparent;
  border: 1px solid var(--gold-line);
  color: var(--text);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s, border-color 0.15s;
}
.pill-btn:hover { background: var(--gold-soft); border-color: var(--gold-bright); }
.pill-btn--gold {
  background: var(--gold-soft);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}
.pill-btn--gold:hover { background: var(--gold); color: var(--bg); }
.pill-btn:disabled { opacity: 0.6; cursor: default; }

/* ======================== Password gate ======================== */

.gate-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}
.gate {
  width: 100%;
  max-width: 480px;
}
.gate-card {
  background: var(--surface);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.gate-title {
  font-size: 2rem;
  margin: 0 0 0.5rem;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gate-subtitle {
  color: var(--text-muted);
  margin: 0 0 2rem;
}
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.gate-form input[type="password"] {
  background: var(--bg);
  border: 1px solid var(--gold-line);
  color: var(--text);
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gate-form input[type="password"]:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.gate-error {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 0;
}
.gate-note {
  margin: 1.75rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ======================== Page header ======================== */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--gold-line);
  background: rgba(15, 20, 25, 0.7);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand-mark { color: var(--gold-bright); }
.brand-name {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ======================== Team page ======================== */

.team {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.team-intro h1 {
  font-size: 2.4rem;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}
.team-intro .lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 0 2.5rem;
}

.specialists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.specialist-card {
  background: var(--surface);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s, background 0.18s;
  outline: none;
}
.specialist-card--active:hover,
.specialist-card--active:focus {
  border-color: var(--gold-bright);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(212, 175, 55, 0.15);
  background: var(--surface-2);
}
.specialist-card--coming {
  opacity: 0.65;
  cursor: default;
  border-style: dashed;
}

.card-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2b2218, #1a2129);
  border: 1px solid var(--gold-line);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-avatar-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: -1;
}
.card-avatar--placeholder {
  background: var(--surface-2);
  color: var(--text-muted);
}

.card-body { flex: 1; min-width: 0; }
.card-name {
  font-size: 1.2rem;
  margin: 0 0 0.25rem;
}
.card-role {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.card-blurb {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0.25rem 0 0.75rem;
}
.card-cta {
  color: var(--coral);
  font-weight: 600;
  font-size: 0.9rem;
}
.card-cta--muted {
  color: var(--text-muted);
}

.workspace-preview {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gold-line);
}
.ws-preview-item {
  background: var(--surface);
  border: 1px solid var(--gold-line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-top: 0.75rem;
}
.ws-preview-item strong { color: var(--gold-bright); }
.ws-preview-item p { margin: 0.35rem 0 0; color: var(--text-muted); font-size: 0.9rem; }

/* ======================== Chat page ======================== */

.chat-page { display: flex; flex-direction: column; min-height: 100vh; }
.chat-header { gap: 1rem; }
.chat-header-tool {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}
.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--gold-line);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-bright);
  font-weight: 700;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-tool-name { font-size: 1.05rem; margin: 0; }
.chat-tool-role { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

.back-link {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.back-link:hover { color: var(--gold-bright); }

.chat-main {
  display: flex;
  flex: 1;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 11rem;
  gap: 1.5rem;
  position: relative;
}
.chat-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.bubble {
  display: flex;
  gap: 0.85rem;
  width: 100%;
  max-width: 100%;
  align-items: flex-start;
}
.bubble--user .bubble-body {
  background: var(--gold-soft);
  border-color: var(--gold-line);
  color: var(--text);
}
.bubble-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--gold-line);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.08), 0 6px 18px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-bright);
  font-size: 0.85rem;
  font-weight: 600;
}
.bubble-avatar img { width: 100%; height: 100%; object-fit: cover; }

.bubble-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.bubble-body {
  background: var(--surface);
  border: 1px solid var(--gold-line);
  border-radius: 14px;
  padding: 0.95rem 1.15rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.bubble--streaming .bubble-body::after {
  content: '▍';
  color: var(--gold-bright);
  margin-left: 0.15rem;
  animation: blink 1s infinite;
}
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
.bubble--greeting .bubble-body {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.08);
}

.bubble-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.bubble--user .bubble-actions { display: none; }

.chat-input-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--gold-line);
  padding: 1rem 1.5rem 1.25rem;
}
.chat-input-form {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}
.chat-input-form textarea {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--gold-line);
  border-radius: 14px;
  color: var(--text);
  padding: 0.85rem 1rem;
  font: inherit;
  resize: none;
  min-height: 48px;
  max-height: 240px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-input-form textarea:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.mic-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--gold-line);
  color: var(--gold-bright);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.06s;
  flex-shrink: 0;
}
.mic-btn:hover {
  background: var(--gold-soft);
  border-color: var(--gold-bright);
}
.mic-btn:active { transform: scale(0.96); }
.mic-btn--listening {
  background: var(--coral);
  border-color: var(--coral);
  color: white;
  animation: mic-pulse 1.2s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 61, 0.55); }
  50% { box-shadow: 0 0 0 10px rgba(255, 107, 61, 0); }
}

.chat-hint {
  max-width: var(--maxw);
  margin: 0.4rem auto 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
}

/* ======================== Workspace panel ======================== */

.workspace-panel {
  width: 320px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  padding: 1.2rem;
  height: fit-content;
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 200px);
  overflow: auto;
}
.workspace-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.workspace-body { margin: 1rem 0; display: flex; flex-direction: column; gap: 0.75rem; }
.ws-item {
  background: var(--surface-2);
  border: 1px solid var(--gold-line);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
}
.ws-item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.ws-item-head strong { color: var(--gold-bright); }
.ws-item-meta { color: var(--text-muted); font-size: 0.75rem; }
.ws-item-body {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 8em;
  overflow: hidden;
  font-family: inherit;
}

@media (max-width: 820px) {
  .workspace-panel {
    position: fixed;
    top: 80px;
    right: 1rem;
    left: 1rem;
    width: auto;
    z-index: 20;
    max-height: calc(100vh - 160px);
  }
}

/* ======================== Modal ======================== */

.modal {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 420px;
  width: calc(100% - 2rem);
  box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px); }
.modal h3 { margin-top: 0; color: var(--gold-bright); }
.modal label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 1rem 0 0.4rem;
}
.modal input[type="email"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--gold-line);
  color: var(--text);
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font: inherit;
}
.modal input[type="email"]:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.25rem;
}
