:root {
  --bg: #081120;
  --bg-2: #0c172a;
  --panel: rgba(12, 23, 42, 0.78);
  --panel-strong: rgba(15, 27, 48, 0.9);
  --panel-soft: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef4ff;
  --text-soft: #b7c5df;
  --text-dim: #8ea0c0;
  --brand: #6ea8ff;
  --brand-strong: #4f8cff;
  --brand-glow: rgba(110, 168, 255, 0.28);
  --success: #60d394;
  --danger: #ff7b7b;
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 36px rgba(0, 0, 0, 0.22);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --content-width: 1100px;
}

* {
  box-sizing: border-box;
}

html {
  background:
    radial-gradient(circle at top left, rgba(79, 140, 255, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(118, 92, 255, 0.16), transparent 24%),
    linear-gradient(180deg, #0a1324 0%, #09111f 100%);
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.55;
  background:
    radial-gradient(circle at 10% 10%, rgba(76, 132, 255, 0.14), transparent 25%),
    radial-gradient(circle at 85% 15%, rgba(111, 63, 255, 0.12), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(40, 120, 255, 0.1), transparent 30%),
    linear-gradient(180deg, #09111f 0%, #0b1324 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.38), transparent 90%);
}

.site-shell {
  position: relative;
  min-height: 100vh;
}

.sr-only {
  position: absolute;
  left: -9999px;
}

/* ===== Ad Banner ===== */

.ad-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  backdrop-filter: blur(14px);
  background: rgba(8, 17, 32, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ad-banner-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  min-height: 90px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.ad-label {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

/* ===== Header ===== */

.site-header {
  padding: 22px 20px 0;
}

.site-header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(8, 17, 32, 0.58);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: white;
  background:
    linear-gradient(135deg, var(--brand-strong), #8a63ff);
  box-shadow:
    0 10px 28px rgba(79, 140, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: white;
}

.site-tagline {
  margin: 0;
  font-size: 14px;
  color: var(--text-soft);
}

/* ===== Tabs ===== */

.site-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-link {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.tab-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
  transform: translateY(-1px);
}

.tab-link-active {
  color: white;
  background: linear-gradient(
    180deg,
    rgba(110, 168, 255, 0.26),
    rgba(110, 168, 255, 0.12)
  );
  border-color: rgba(110, 168, 255, 0.34);
  box-shadow: 0 0 0 1px rgba(110, 168, 255, 0.1) inset;
}

/* ===== Main ===== */

.app-main {
  max-width: var(--content-width);
  margin: 26px auto 48px;
  padding: 0 20px;
}

.tab-panel {
  display: block;
}

.tab-panel-hidden {
  display: none;
}

/* ===== Shared Card Styles ===== */

.hero-card,
.chat-card,
.about-card {
  border: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    rgba(14, 25, 46, 0.86) 0%,
    rgba(10, 20, 36, 0.9) 100%
  );
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.hero-card,
.chat-card {
  border-radius: var(--radius-xl);
}

.about-card {
  border-radius: var(--radius-xl);
}

.section-kicker,
.hero-eyebrow {
  margin: 0 0 10px 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.panel-title {
  margin: 0;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: white;
}

.panel-subtitle {
  margin: 8px 0 0 0;
  max-width: 700px;
  font-size: 15px;
  color: var(--text-soft);
}

/* ===== Hero ===== */

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 34px;
  margin-bottom: 22px;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -20% auto auto -10%;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: radial-gradient(circle, var(--brand-glow) 0%, transparent 68%);
  pointer-events: none;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -10% -24% auto;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(138, 99, 255, 0.22) 0%, transparent 68%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-title {
  margin: 0;
  max-width: 760px;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.96;
  letter-spacing: -0.06em;
  color: white;
}

.hero-subtitle {
  margin: 16px 0 0 0;
  max-width: 760px;
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--text-soft);
}

.hero-points {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  color: #e9f2ff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

/* ===== Chat Card ===== */

.chat-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.chat-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

/* ===== Download Panel ===== */

.download-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
}

.download-copy {
  max-width: 680px;
}

.download-copy h4 {
  margin: 0;
  font-size: 18px;
  color: white;
  letter-spacing: -0.02em;
}

.download-copy p {
  margin: 8px 0 0 0;
  font-size: 14px;
  color: var(--text-soft);
}

.download-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 170px;
}

.model-status {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  text-align: right;
}

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

.primary-button {
  appearance: none;
  border: 1px solid rgba(110, 168, 255, 0.3);
  background:
    linear-gradient(180deg, #5d97ff 0%, #3f7ff7 100%);
  color: white;
  padding: 11px 16px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow:
    0 12px 28px rgba(63, 127, 247, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 18px 34px rgba(63, 127, 247, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow:
    0 8px 18px rgba(63, 127, 247, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.send-button {
  min-width: 102px;
}

/* ===== Transcript ===== */

.chat-transcript-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-transcript-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.chat-transcript-title {
  margin: 0;
  font-size: 16px;
  color: white;
}

.chat-transcript-note {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
}

.chat-messages {
  height: 420px;
  overflow-y: auto;
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.chat-messages::-webkit-scrollbar {
  width: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

/* ===== Messages ===== */

.chat-message {
  display: flex;
}

.chat-message-inner {
  max-width: min(76%, 720px);
  padding: 11px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-message-user {
  justify-content: flex-end;
}

.chat-message-user .chat-message-inner {
  color: white;
  background:
    linear-gradient(180deg, #5d97ff 0%, #437ef2 100%);
  box-shadow: 0 10px 26px rgba(67, 126, 242, 0.24);
  border-bottom-right-radius: 6px;
}

.chat-message-assistant {
  justify-content: flex-start;
}

.chat-message-assistant .chat-message-inner {
  color: #edf3ff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}

/* ===== Input ===== */

.chat-input-form {
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-input {
  flex: 1;
  min-height: 52px;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.055);
  color: white;
  padding: 0 16px;
  font-size: 15px;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    opacity 0.15s ease;
}

.chat-input::placeholder {
  color: #91a5c7;
}

.chat-input:focus {
  border-color: rgba(110, 168, 255, 0.48);
  box-shadow: 0 0 0 4px rgba(110, 168, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
}

.chat-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== About ===== */

.about-card {
  padding: 28px;
}

.about-header {
  margin-bottom: 18px;
}

.about-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 16px;
  color: var(--text-soft);
}

.about-copy p {
  margin: 0;
}

.about-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.about-feature {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
}

.about-feature h3 {
  margin: 0 0 6px 0;
  font-size: 18px;
  color: white;
  letter-spacing: -0.02em;
}

.about-feature p {
  margin: 0;
  font-size: 14px;
  color: var(--text-soft);
}

.about-note {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.about-note p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}

/* ===== Responsive ===== */

@media (max-width: 900px) {
  .site-header {
    padding: 16px 14px 0;
  }

  .site-header-inner {
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
  }

  .brand-block {
    align-items: center;
  }

  .download-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .download-actions {
    align-items: stretch;
    min-width: 0;
  }

  .model-status {
    text-align: left;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ad-banner-inner {
    min-height: 100px;
    padding: 8px 10px;
    flex-direction: column;
    gap: 8px;
  }

  .site-title {
    font-size: 20px;
  }

  .site-tagline {
    font-size: 13px;
  }

  .app-main {
    margin: 18px auto 34px;
    padding: 0 12px;
  }

  .hero-card,
  .chat-card,
  .about-card {
    padding: 18px;
    border-radius: 20px;
  }

  .hero-title {
    font-size: 34px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .chat-messages {
    height: 360px;
    border-radius: 18px;
  }

  .chat-input-form {
    flex-direction: column;
    align-items: stretch;
  }

  .send-button {
    width: 100%;
  }

  .chat-message-inner {
    max-width: 88%;
  }
}