:root {
  --bg: #fbfcff;
  --panel: #ffffff;
  --ink: #071735;
  --text: #11182b;
  --muted: #657086;
  --line: #e3e8f2;
  --blue: #3167f4;
  --blue-dark: #2455d7;
  --blue-soft: #edf3ff;
  --green: #46ba8c;
  --shadow: 0 22px 54px rgba(27, 45, 84, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at 50% 0%, rgba(49, 103, 244, 0.1), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 44px;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
}

.brand {
  align-items: center;
  color: #050914;
  display: inline-flex;
  font-size: 1.72rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand-badge {
  background: var(--blue);
  border-radius: 8px;
  color: #fff;
  line-height: 1;
  margin-left: 3px;
  padding: 4px 6px 6px;
}

.topbar p {
  color: var(--muted);
  font-weight: 700;
  margin: 0;
  text-align: right;
}

.page {
  margin: 0 auto;
  max-width: 1500px;
  padding: 46px 44px 54px;
}

.hero {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: 34px;
  margin-bottom: 30px;
}

.hero-copy h1 {
  color: var(--ink);
  font-size: clamp(2.5rem, 4.8vw, 4.5rem);
  letter-spacing: -0.045em;
  line-height: 1.02;
  margin: 0 0 16px;
  max-width: 850px;
}

.hero-copy h1 span {
  color: var(--blue);
  display: inline-block;
  position: relative;
}

.hero-copy h1 span::after {
  background: var(--blue);
  border-radius: 999px;
  bottom: -8px;
  content: "";
  height: 5px;
  left: 2px;
  position: absolute;
  right: 4px;
  transform: rotate(-3deg);
}

.hero-copy p {
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.45;
  margin: 0;
  max-width: 760px;
}

.speech-demo {
  height: 150px;
  position: relative;
}

.bubble {
  border-radius: 20px;
  box-shadow: var(--shadow);
  font-size: 1.02rem;
  font-weight: 760;
  line-height: 1.5;
  position: absolute;
}

.bubble.polite {
  background: #fff;
  border: 1px solid var(--line);
  left: 10px;
  padding: 20px 31px;
  top: 8px;
}

.bubble.polite::after {
  border-left: 12px solid transparent;
  border-top: 16px solid #fff;
  bottom: -13px;
  content: "";
  left: 42px;
  position: absolute;
}

.bubble.honest {
  background: var(--blue);
  border-bottom-right-radius: 10px;
  color: #fff;
  padding: 20px 34px;
  right: 6px;
  top: 58px;
}

.arrow {
  color: var(--ink);
  font-size: 4rem;
  left: 226px;
  line-height: 1;
  position: absolute;
  top: 8px;
  transform: rotate(10deg);
}

.translator-board {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
  gap: 18px;
}

.translator-card,
.feed-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.translator-card {
  min-height: 430px;
  padding: 25px 28px 22px;
}

.card-title {
  align-items: center;
  color: #0d1730;
  display: flex;
  font-size: 1.15rem;
  font-weight: 850;
  justify-content: space-between;
  margin-bottom: 14px;
}

.title-icon {
  display: inline-flex;
  margin-right: 10px;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.small-button,
.translate-button {
  border-radius: 9px;
  font-weight: 800;
}

.small-button {
  background: #fff;
  border: 1px solid var(--line);
  color: #34405a;
  height: 36px;
  padding: 0 14px;
}

.small-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.textarea-wrap,
.truth-box {
  position: relative;
}

textarea {
  background: #fff;
  border: 1px solid #cfd7e6;
  border-radius: 10px;
  color: var(--text);
  line-height: 1.45;
  min-height: 250px;
  padding: 18px;
  resize: vertical;
  width: 100%;
}

textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(49, 103, 244, 0.1);
  outline: none;
}

.counter {
  bottom: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  position: absolute;
  right: 14px;
}

.translate-button {
  align-items: center;
  background: var(--blue);
  border: 0;
  box-shadow: 0 14px 25px rgba(49, 103, 244, 0.24);
  color: #fff;
  display: flex;
  gap: 10px;
  height: 46px;
  justify-content: center;
  margin-top: 18px;
  width: 100%;
}

.translate-button:hover {
  background: var(--blue-dark);
}

.translate-button kbd {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  font: inherit;
  margin-left: auto;
  padding: 4px 9px;
}

.swap-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow);
  display: flex;
  font-size: 2rem;
  height: 62px;
  justify-content: center;
  width: 62px;
  z-index: 2;
}

.truth-box {
  background: linear-gradient(135deg, #f8fffb 0%, #f3fbff 100%);
  border: 1px solid #cfe2d9;
  border-radius: 10px;
  min-height: 316px;
  padding: 22px 18px 48px;
}

#truthOutput {
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 680;
  line-height: 1.65;
  white-space: pre-line;
}

.confidence {
  align-items: center;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid #d9e5e1;
  border-radius: 999px;
  bottom: 12px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.78rem;
  gap: 7px;
  left: 14px;
  padding: 6px 11px;
  position: absolute;
}

.confidence i,
.live-pill i {
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
  height: 9px;
  width: 9px;
}

.confidence strong {
  color: #1f9b71;
}

.output-counter {
  bottom: 16px;
}

.feed-panel {
  margin-top: 28px;
  padding: 22px 24px 14px;
}

.feed-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 16px;
}

.feed-header h2 {
  align-items: center;
  color: var(--ink);
  display: flex;
  font-size: 1.25rem;
  gap: 10px;
  margin: 0 0 5px;
}

.feed-header p {
  color: var(--muted);
  margin: 0;
}

.live-pill {
  align-items: center;
  background: var(--blue-soft);
  border: 1px solid #d6e2ff;
  border-radius: 999px;
  color: var(--blue);
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 850;
  gap: 8px;
  padding: 8px 12px;
  white-space: nowrap;
}

.feed-list {
  display: grid;
}

.feed-item {
  border-bottom: 1px solid #edf1f7;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) 82px;
  gap: 18px;
  padding: 16px 0;
}

.feed-item.is-new {
  animation: slideIn 300ms ease;
}

.feed-item:last-child {
  border-bottom: 0;
}

.feed-item b,
.feed-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-item b {
  color: #17213a;
  font-size: 0.95rem;
}

.feed-item span {
  color: var(--muted);
}

.feed-item em {
  color: var(--muted);
  font-size: 0.84rem;
  font-style: normal;
  justify-self: end;
}

.empty-feed {
  background: #f7faff;
  border: 1px dashed #cbd8f1;
  border-radius: 12px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  margin: 18px 0 10px;
  padding: 22px;
  text-align: center;
}

.empty-feed strong {
  color: var(--ink);
  font-size: 1.05rem;
}

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

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

  .speech-demo {
    display: none;
  }

  .translator-board {
    grid-template-columns: 1fr;
  }

  .swap-button {
    justify-self: center;
    transform: rotate(90deg);
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 18px 20px;
  }

  .topbar p {
    text-align: left;
  }

  .page {
    padding: 34px 18px;
  }

  .hero-copy h1 {
    font-size: 2.45rem;
  }

  .translator-card,
  .feed-panel {
    padding: 18px 16px;
  }

  .card-title,
  .feed-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .card-actions {
    width: 100%;
  }

  .card-actions .small-button {
    flex: 1;
  }

  .feed-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .feed-item em {
    justify-self: start;
  }
}
