:root {
  color-scheme: dark;
  --bg: #04101d;
  --bg-2: #07182b;
  --panel: rgba(10, 18, 36, 0.72);
  --panel-strong: rgba(8, 12, 24, 0.88);
  --line: rgba(255, 255, 255, 0.12);
  --text: #eff7ff;
  --muted: rgba(239, 247, 255, 0.72);
  --cyan: #44f3ff;
  --mint: #7cffb0;
  --gold: #ffd36b;
  --pink: #ff6dc2;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body.ai-core-page {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(68, 243, 255, 0.22), transparent 22%),
    radial-gradient(circle at 88% 18%, rgba(255, 109, 194, 0.16), transparent 20%),
    radial-gradient(circle at 80% 86%, rgba(124, 255, 176, 0.16), transparent 22%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  overflow-x: hidden;
}

.core-glow {
  position: fixed;
  inset: auto;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.core-glow-a { top: -8rem; left: -10rem; background: rgba(68, 243, 255, 0.22); }
.core-glow-b { top: 6rem; right: -12rem; background: rgba(255, 211, 107, 0.18); }
.core-glow-c { bottom: -12rem; left: 28%; background: rgba(124, 255, 176, 0.16); }

.core-shell {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
  padding: 22px 12px 56px;
}

.core-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.core-seal-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 211, 107, 0.12), rgba(68, 243, 255, 0.08));
}

.core-seal-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 0.98rem;
}

.core-seal-strip p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  max-width: 68ch;
}

.core-seal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 211, 107, 0.18);
  border: 1px solid rgba(255, 211, 107, 0.3);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

:root[data-capps-active="false"] .core-shell,
:root[data-capps-active="false"] .core-terminal {
  filter: saturate(0.7);
}

.core-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.core-brand strong {
  display: block;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.core-brand small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.core-brand-mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  box-shadow: 0 0 18px rgba(68, 243, 255, 0.7);
}

.core-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.core-nav a,
.core-inline-link,
.core-link-list a {
  color: inherit;
  text-decoration: none;
}

.core-nav a {
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.core-nav a:hover,
.core-link-list a:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.core-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 320px;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 14% 14%, rgba(68, 243, 255, 0.18), transparent 26%),
    radial-gradient(circle at 84% 18%, rgba(255, 211, 107, 0.14), transparent 22%),
    rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.core-kicker,
.core-panel-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 0 12px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.core-hero h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.6rem, 6vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.core-lede,
.core-panel-copy,
.core-disclaimer {
  color: var(--muted);
  line-height: 1.6;
}

.core-lede {
  max-width: 66ch;
  margin: 16px 0 0;
  font-size: 1.05rem;
}

.core-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.core-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-decoration: none;
  font-weight: 900;
  color: inherit;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.core-button:hover { transform: translateY(-1px); }

.core-button-primary {
  background: linear-gradient(135deg, var(--cyan), var(--gold));
  color: #03101c;
  border-color: transparent;
}

.core-button-secondary { background: rgba(255, 255, 255, 0.06); }
.core-button-ghost { background: rgba(255, 255, 255, 0.03); }

.core-badges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.core-badge,
.core-stat-card,
.core-panel,
.core-terminal,
.core-hero-panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.core-badge {
  padding: 12px;
}

.core-badge span,
.core-stat-card span,
.core-quote-row span,
.terminal-cost span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.core-badge strong,
.core-stat-card strong,
.core-quote-row strong,
.terminal-cost strong {
  display: block;
  margin-top: 6px;
  font-size: 1.02rem;
}

.core-hero-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.core-stat-card {
  padding: 16px;
  background: rgba(8, 12, 24, 0.7);
}

.core-stat-card strong {
  font-size: 1.3rem;
}

.core-stat-card small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.5;
}

.core-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.core-side {
  display: grid;
  gap: 16px;
  align-content: start;
}

.core-panel {
  padding: 18px;
}

.core-panel h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.core-quote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.core-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.core-chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font-weight: 800;
  cursor: pointer;
}

.core-chip:hover {
  background: rgba(255, 255, 255, 0.1);
}

.core-link-list {
  display: grid;
  gap: 10px;
}

.core-link-list a {
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
}

.core-terminal {
  min-height: 780px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(6, 9, 18, 0.86);
}

.core-terminal-topbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.terminal-lights {
  display: flex;
  gap: 7px;
}

.terminal-lights span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}

.terminal-title {
  color: var(--muted);
  font-size: 0.9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.terminal-cost {
  justify-self: end;
  text-align: right;
}

.core-messages {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
}

.core-message {
  max-width: 86%;
  display: grid;
  gap: 8px;
  animation: messageIn 0.2s ease-out;
}

.core-message.user { align-self: flex-end; }
.core-message.assistant { align-self: flex-start; }

.message-meta {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.message-bubble {
  padding: 14px 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  line-height: 1.62;
  white-space: pre-wrap;
  word-break: break-word;
}

.core-message.user .message-bubble {
  background: linear-gradient(135deg, rgba(68, 243, 255, 0.16), rgba(255, 211, 107, 0.12));
}

.core-message.assistant .message-bubble {
  background: rgba(255, 255, 255, 0.05);
}

.core-input-area {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.core-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.core-form textarea {
  min-height: 56px;
  max-height: 180px;
  resize: vertical;
  padding: 14px 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  outline: none;
}

.core-form button {
  min-height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--cyan), var(--mint));
  color: #03101c;
  font-weight: 1000;
  cursor: pointer;
}

.core-form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.core-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.core-disclaimer {
  margin: 0;
  font-size: 0.84rem;
}

.core-input-help {
  margin: 8px 0 0;
  color: rgba(239, 247, 255, 0.52);
  font-size: 0.76rem;
  line-height: 1.45;
}

.core-inline-link {
  white-space: nowrap;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
}

.core-inline-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1080px) {
  .core-hero,
  .core-grid {
    grid-template-columns: 1fr;
  }

  .core-terminal {
    min-height: 700px;
  }
}

@media (max-width: 720px) {
  .core-topbar,
  .core-terminal-topbar,
  .core-footer-row,
  .core-form {
    grid-template-columns: 1fr;
    display: grid;
  }

  .core-nav {
    justify-content: flex-start;
  }

  .core-message {
    max-width: 94%;
  }

  .core-badges {
    grid-template-columns: 1fr;
  }
}
