


:root{
  --bg: #f5f7fb;
  --surface: #ffffff;
  --muted: #64748b;
  --text: #0f172a;
  --accent-1: #2563eb; /* primary */
  --accent-2: #06b6d4; /* secondary */
  --glass: rgba(255,255,255,0.55);
  --glass-border: rgba(15,23,42,0.08);
  --border-strong: rgba(15,23,42,0.2);
  --card-shadow: 0 8px 24px rgba(15,23,42,0.06);
  --radius: 12px;
  --container-width: 1200px;
}

:root.dark{
  --bg: #0b0b0f;
  --surface: rgba(255,255,255,0.02);
  --muted: #9aa4b2;
  --text: #e6eef8;
  --accent-1: #60a5fa;
  --accent-2: #06b6d4;
  --glass: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.2);
  --card-shadow: 0 12px 40px rgba(2,6,23,0.6);
  --ring-shadow: rgba(0,0,0,0.4);
}

* { box-sizing: border-box; transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
html,body { height: 100%; margin: 0; padding: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; background: var(--bg); color: var(--text); }

.container { max-width: var(--container-width); margin: 0 auto; padding: 0 20px; }

.site-header {
  position: relative; /* Changed from sticky to relative for full-screen chat layout */
  top: 16px;
  z-index: 80;
  display: block; /* Changed from flex */
  justify-content: center;
  padding: 12px 20px;
}

.site-nav {
  width: 100%;
  max-width: var(--container-width);
  display: flex; /* Keep flex for nav items */
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(180deg, var(--glass), rgba(255,255,255,0.02));
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  backdrop-filter: blur(8px) saturate(120%);
  margin: 16px auto; /* Center the nav bar */
  box-shadow: var(--card-shadow);
}

.nav-left, .nav-right { display:flex; align-items:center; gap:12px; }
.brand { display:flex; align-items:center; gap:12px; text-decoration:none; color:var(--text); font-weight:700; }
.brand .logo { width:40px; height:40px; display:inline-block; }

.nav-links { display:flex; gap:8px; align-items:center; }
.nav-link {
  text-decoration:none;
  color:var(--text);
  padding:8px 12px;
  border-radius:10px;
  font-weight:600;
  font-size:0.95rem;
}
.nav-link:hover { background: rgba(15,23,42,0.02); }

/* small pill button style for actions */
.btn {
  border: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg,var(--accent-1),var(--accent-2));
  color: white;
  cursor: pointer;
  font-weight:700;
  font-size:0.95rem;
}
.btn.ghost {
  background: transparent;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid var(--glass-border);
  color: var(--text);
}

#theme-toggle { font-weight:600; }

.layout { min-height:100vh; display:flex; flex-direction:column; gap:28px; padding-bottom:40px; } /* Keep for index.html */
.hero {
  margin: 28px auto;
  padding: 44px 36px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  box-shadow: var(--card-shadow);
  text-align: left;
}
.hero h1 { font-size: clamp(34px, 5vw, 56px); margin:0 0 12px; line-height:1.05; }

/* Screenshots grid on landing */
.screenshots-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap:22px; margin-top:18px; }
.screenshot-card { display: block; text-decoration: none; background: linear-gradient(180deg, var(--surface), rgba(255,255,255,0.02)); border:1px solid var(--glass-border); border-radius:16px; height:360px; cursor:pointer; box-shadow: var(--card-shadow); overflow:hidden; transform: translateY(0); transition: transform .28s cubic-bezier(.2,.9,.2,1), box-shadow .28s ease; position: relative; }
.screenshot-card:focus, .screenshot-card:hover { transform: translateY(-6px); box-shadow: 0 22px 48px rgba(2,6,23,0.12); }
.screenshot-inner { color: var(--muted); font-weight:700; padding:12px; text-align:center; font-size:1.05rem; }
.screenshot-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.screenshot-card::after { content: ''; position:absolute; inset:0; background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.02)); pointer-events:none; }
.screenshot-card:hover .screenshot-image { transform: scale(1.05); }

/* CTA */
.cta-button {
  display:inline-block;
  padding: 12px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-weight:700;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  color: white;
}

.features { margin: 28px auto; max-width: var(--container-width); padding: 0 20px; }
.features-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.features-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.feature-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.01), transparent);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--card-shadow);
  display:flex;
  gap: 16px;
  align-items:flex-start;
  transition: transform .22s ease, box-shadow .22s ease;
}
feature-card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(2,6,23,0.12); }
.feature-icon { width:64px; height:64px; border-radius:14px; display:inline-flex; align-items:center; justify-content:center; background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.00)); border:1px solid var(--glass-border); }
.feature-icon .icon-label { font-weight:700; color:var(--accent-1); font-size:1rem; }
.feature-title { font-weight:700; margin:0 0 8px; }
.feature-desc { margin:0; color:var(--muted); font-size:0.95rem; line-height: 1.6; }

.auth-page { display:flex; justify-content:center; align-items:center; padding: 36px 20px; }
.auth-container {
  width:100%;
  max-width:420px;
  margin: 28px auto;
  padding: 28px;
  display:block;
  background: linear-gradient(180deg, var(--surface), rgba(255,255,255,0.02));
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--card-shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.auth-container:focus-within { transform: translateY(-4px); }
.auth-inner { display:flex; flex-direction:column; gap:12px; }
.form-stack { display:flex; flex-direction:column; gap:12px; }
.form-group label { display:block; margin-bottom:6px; font-weight:700; color:var(--text); }
.form-group input { width:100%; padding:12px 14px; border-radius:10px; border:1px solid var(--glass-border); background:var(--input-bg,transparent); color:var(--text); font-size:1rem; }
.auth-actions-vertical { display:flex; flex-direction:column; gap:10px; margin-top:6px; }
.auth-actions-vertical .btn { width:100%; padding:12px 14px; font-weight:800; }
.auth-actions-vertical .btn.ghost { background:transparent; border:1px solid var(--glass-border); }
.auth-container h2 { margin:0 0 6px; font-size:1.6rem; }
.chat-container {
  display: flex;
  flex-grow: 1; /* Allow chat container to take full height of main */
  padding: 0;
  gap: 0;
  margin: 0;
  height: calc(100vh - 80px); /* Adjust height to account for header */
}

.chat-sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--surface);
  border-radius: 0;
  border-right: 1px solid var(--glass-border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* Allow sidebar content to scroll */
}

.chat-sidebar h4 { margin-top: 0; }

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg); /* Use main background */
  border-radius: 0;
  padding: 0;
  border: none;
}

.chat-main .chat-header {
  position: sticky; /* Make chat header sticky */
  top: 0;
  z-index: 50;
  background: var(--bg);
  padding: 16px 24px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.chat-main .chat-body {
  flex: 1;
  display: flex;
  justify-content: center;
  overflow-y: auto; /* Enable scrolling for messages */
  padding: 24px; /* Padding around messages */
  padding-top: 0; /* No top padding, chat-header handles it */
 }

.chat-messages {
  padding: 0 16px;
  max-width: 960px;
  width: 100%;
  gap: 24px; /* More space between messages */
}
.empty-chat {
  margin-top: 60px;
}

.message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: none;
}
 .message.user {
  flex-direction: row-reverse; /* User message on right, avatar on right */
  align-self: flex-end;
}
.message.assistant {
  align-self: flex-start;
}
.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0; /* Prevent avatar from shrinking */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--bg);
}
.user-avatar { background: var(--accent-1); }
.assistant-avatar { background: var(--accent-2); }

.message-content {
  padding: 12px 16px;
  border-radius: 18px; /* More rounded corners */
  max-width: calc(100% - 44px);
  line-height: 1.6;
  font-size: 1rem;
  background: var(--surface);
  border: 1px solid var(--glass-border);
}
.message.user .message-content {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  color: white;
}

/* Image Placeholder for loading state */
.image-placeholder {
  position: relative;
  width: 100%;
  max-width: 512px; /* Or a preferred max width */
  aspect-ratio: 1 / 1;
  background-color: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.image-placeholder .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--glass-border);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.message-content img {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
/* Chat Input Container */
.chat-input-container {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 24px;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -8px 24px rgba(2,6,23,0.06);
}
.chat-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  max-width: 960px;
  width: 100%;
}
.message-input { 
  flex: 1;
  min-height: 50px;
  max-height: 200px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 1rem;
  resize: vertical; /* Allow vertical resize */
}
.message-input:focus { outline: none; border-color: var(--accent-1); box-shadow: 0 0 0 3px var(--accent-1-trans); }
.send-button { 
  min-width: 100px;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 600;
}
/* Microphone button */
.send-button { border: 1px solid var(--border-strong); } /* Add border for contrast */
.send-button:hover { border-color: var(--accent-1); }
.mic-button {
  padding: 14px;
  border-radius: 50%;
  min-width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--muted);
}
.mic-button svg {
  flex-shrink: 0;
  transition: stroke 0.2s ease;
}
.mic-button span {
  margin-left: 8px;
}
.mic-button.listening {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: white;
}

.model-selector-wrapper {
  margin: 16px 0 24px;
}
.model-selector-wrapper {
  position: relative;
  display: block;
}
.model-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.model-select:hover {
  border-color: var(--accent-1);
}
.model-select:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px var(--accent-1-trans); /* Ring effect */
}
.model-select-arrow {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
}
.sidebar-action {
  display: flex;
  justify-content: space-between;
  align-items: center;  gap: 10px;

  padding: 0; /* Remove padding for simple link */
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}
.toggle-label {
  font-weight: 600;
  font-size: 0.95rem;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background-color: var(--muted);
  border-radius: 34px;
  border: none;
  cursor: pointer;
  transition: background-color .2s;
}
.toggle-switch[aria-checked="true"] {
  background-color: var(--accent-1);
}
.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transition: transform .2s;
}
.toggle-switch[aria-checked="true"] .toggle-knob {
  transform: translateX(20px);
}

.talk-page-body {
  overflow: hidden; /* Prevent scrollbars */
  background: var(--bg);
}

.talk-header {
  position: fixed;
  top: 20px;
  left: 20px;
  right: 20px;
  z-index: 100; /* Ensure it's above other content */
  display: flex;
  justify-content: center; /* Center items horizontally */
  align-items: center;
  gap: 20px; /* Space between items */
  max-width: 900px; /* Limit width for better alignment */
  margin: 0 auto; /* Center the header itself */
  background: linear-gradient(180deg, var(--glass), rgba(255,255,255,0.02)); /* Add background for visibility */
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  backdrop-filter: blur(8px) saturate(120%);
  padding: 10px 16px;
  box-shadow: var(--card-shadow);
}

.talk-header .model-selector-wrapper {
  flex-grow: 1; /* Allow model selector to take available space */
}
.talk-header .model-select {
  min-width: 250px;
}
.talk-main { 
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px; /* Add perspective for 3D transforms */
}
.jupiter-visualizer-page {
  position: relative;
  width: 350px; /* Slightly larger */
  height: 350px;
  transform-style: preserve-3d;
  transition: transform 0.1s linear; /* Faster transition for mouse move */
  filter: drop-shadow(0 0 25px var(--accent-1));
}

.jupiter-grid, .jupiter-noise, .jupiter-core, .jupiter-glow, .jupiter-rings, .jupiter-inner-rings, .jupiter-signal {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* A subtle, rotating grid for texture */
.jupiter-grid {
  background-image: linear-gradient(var(--glass-border) 1px, transparent 1px), linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0;
  transform: scale(1.5);
  animation: grid-rotate 60s infinite linear;
}

.jupiter-noise {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0;
  transform: scale(1.2);
  mix-blend-mode: overlay;
  animation: noise-pan 15s infinite linear;
}

.jupiter-core {
  background: radial-gradient(circle at center, var(--accent-1) 0%, transparent 60%);
  transform: scale(0.8);
  animation: subtle-pulse 8s infinite ease-in-out;
}

.jupiter-glow {
  background: radial-gradient(circle at center, var(--accent-1), transparent 70%);
  opacity: 0.2;
}

.jupiter-rings {
  transform: rotateX(70deg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 2px 0 var(--ring-shadow), inset 0 1px 0 var(--ring-highlight);

  animation: ring-rotate 30s infinite linear;
}
.jupiter-rings::before, .jupiter-rings::after { /* The 2nd and 3rd rings */
  content: '';
  position: absolute;
  inset: -15%;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  box-shadow: 0 2px 0 var(--ring-shadow), inset 0 1px 0 var(--ring-highlight);
  animation: ring-rotate 20s infinite linear;
}
.jupiter-rings::after {
  inset: -30%;
  animation-direction: reverse;
  animation-duration: 15s;
}

.jupiter-inner-rings {
  transform: rotateX(70deg) scale(0.5);
}
.jupiter-inner-rings::before, .jupiter-inner-rings::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  box-shadow: 0 2px 0 var(--ring-shadow), inset 0 1px 0 var(--ring-highlight);
  animation: ring-rotate 18s infinite linear reverse;
}
.jupiter-inner-rings::after {
  box-shadow: 0 2px 0 var(--ring-shadow), inset 0 1px 0 var(--ring-highlight);
  border-style: dashed;
  animation-duration: 22s;
  animation-direction: linear;
}

/* A signal/wave effect for speaking */
.jupiter-signal {
  border: 1px solid var(--accent-1);
  transform: scale(0.8);
  opacity: 0;
/* Add pseudo-elements for a more complex wave */
.jupiter-signal::before, .jupiter-signal::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--accent-1);
  opacity: 0;
}
.jupiter-signal::before {
  animation: signal-wave-2 1.5s infinite ease-out;
  animation-delay: 0.2s;
}

.jupiter-visualizer-page.listening .jupiter-core {
  transform: scale(0.9);
  filter: brightness(1.2);
}
.jupiter-visualizer-page.listening .jupiter-rings::before,
.jupiter-visualizer-page.listening .jupiter-rings::after {
  border-color: var(--accent-1);
}
.jupiter-visualizer-page.listening .jupiter-inner-rings::before,
.jupiter-visualizer-page.listening .jupiter-inner-rings::after {
  border-color: var(--accent-2);
}

  animation: subtle-pulse 1.5s infinite ease-in-out;
}
.jupiter-visualizer-page.speaking .jupiter-signal {
  /* The main signal element */
  animation: signal-wave 1.5s infinite ease-out;
}

.jupiter-visualizer-page.thinking .jupiter-core {
  transform: scale(0.75);
  filter: brightness(0.8);
}
.jupiter-visualizer-page.thinking .jupiter-grid {
  opacity: 0.05;
  opacity: 0.1;
  animation-duration: 10s;
}
.jupiter-visualizer-page.thinking .jupiter-rings::before,
.jupiter-visualizer-page.thinking .jupiter-rings::after {
  border-color: var(--accent-2);
  animation-duration: 5s;
}
.jupiter-visualizer-page.thinking .jupiter-inner-rings::before,
.jupiter-visualizer-page.thinking .jupiter-inner-rings::after {
  border-color: var(--accent-2);
  animation-duration: 5s;
}

.talk-transcript-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35vh;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.5));
  z-index: 50;
  display: flex;
  justify-content: center; 
  padding: 20px;
  pointer-events: none; /* Allow clicks through */
}
.talk-transcript {
  width: 100%;
  max-width: 800px;
  overflow-y: auto;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  pointer-events: all; /* Enable scroll on transcript */
}
.transcript-entry { margin-bottom: 1em; }
.transcript-entry p { margin: 0.2em 0; }

@keyframes subtle-pulse { 0%, 100% { transform: scale(0.8); opacity: 0.9; } 50% { transform: scale(0.82); opacity: 1; } }
@keyframes grid-rotate { from { transform: scale(1.5) rotate(0deg); } to { transform: scale(1.5) rotate(360deg); } }
@keyframes ring-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes noise-pan { 0% { transform: scale(1.2) translate(0,0); } 100% { transform: scale(1.2) translate(-100px, 100px); } }
@keyframes signal-wave { from { transform: scale(0.8); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
@keyframes signal-wave-2 { from { transform: scale(0.8); opacity: 0.7; } to { transform: scale(1.5); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 960px) {
  .features-grid {
    grid-template-columns: 1fr; /* Stack feature cards on smaller tablets */
  }
}

@media (max-width: 768px) {
  .site-header { position: relative; top: 0; } /* Reset header position */
  .site-nav { margin: 0 auto; border-radius: 0; border: none; border-bottom: 1px solid var(--glass-border); box-shadow: none; }
  .chat-container { flex-direction: column; height: auto; }
  .chat-sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--glass-border); padding-top: 24px; }
  .chat-main { margin-left: 0; }
  .chat-main .chat-header { position: relative; top: auto; left: auto; right: auto; border-bottom: none; padding: 16px 18px; }
  .chat-main .chat-body { padding: 16px; }
  .chat-input-container { padding: 16px; }

  /* Responsive talk page */
  .talk-header {
    flex-direction: column;
    gap: 12px;
    position: relative;
    top: 0;
    padding: 16px;
  }
  .talk-main {
    height: auto;
    min-height: 50vh;
  }
}

.credits-list { list-style:none; padding-left:0; display:flex; gap:18px; margin-top:12px; }
.credits-list li { background: var(--surface); padding:10px 14px; border-radius:10px; border:1px solid var(--glass-border); color:var(--text); font-weight:700; }

.feature-card, .screenshot-card, .auth-container, .chat-main { will-change: transform, opacity; }
.message-content { transition: transform .12s ease, opacity .12s ease; }
.message.assistant.entering .message-content { transform: translateY(4px); opacity:0; }
.message.assistant.entering .message-content.in { transform: translateY(0); opacity:1; }
