/* Base Reset & Variables for the Block */
:root {
  --c-marker: #bff621;
  --c-accent: #ffd700;
  --c-brutal: #111111;
  --c-bg: #fafafa;
  --shadow-sm: 2px 2px 0px 0px rgba(17, 17, 17, 1);
  --shadow-md: 4px 4px 0px 0px rgba(17, 17, 17, 1);
  --shadow-lg: 6px 6px 0px 0px rgba(17, 17, 17, 1);
  --shadow-xl: 10px 10px 0px 0px rgba(17, 17, 17, 1);

  --tg-bg: #e4e5e8;
  --tg-msg-bg: #ffffff;
  --tg-user-msg-bg: #efffde;
  --tg-btn-bg: rgba(42, 171, 238, 0.1);
  --tg-btn-text: #2aabee;

  --max-blue: #2aabee;
  --max-blue-hover: #229ed9;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--c-brutal);
  background-color: var(--c-bg);
  background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
  background-size: 20px 20px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

::selection {
  background-color: var(--c-marker);
  color: #000;
}

h1, h2, h3, p {
  margin: 0;
}

.mx-title-1 {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.mx-title-2 {
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 2rem;
}

.mx-title-3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.mx-text-lg { font-size: 1.125rem; }
.mx-text-xl { font-size: 1.25rem; }

@media (min-width: 768px) {
  .mx-title-1 { font-size: 3.75rem; }
  .mx-title-2 { font-size: 3rem; }
}

/* Layout */
.mx-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}
.mx-section { padding: 4rem 1rem; }
.mx-text-center { text-align: center; }
.mx-flex { display: flex; }
.mx-flex-col { flex-direction: column; }
.mx-items-center { align-items: center; }
.mx-justify-center { justify-content: center; }
.mx-justify-between { justify-content: space-between; }
.mx-gap-2 { gap: 0.5rem; }
.mx-gap-4 { gap: 1rem; }
.mx-gap-6 { gap: 1.5rem; }
.mx-gap-8 { gap: 2rem; }
.mx-gap-12 { gap: 3rem; }

.mx-grid { display: grid; gap: 2rem; }
.mx-grid-2 { grid-template-columns: 1fr; }
.mx-grid-3 { grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .mx-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .mx-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .mx-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Utils */
.mx-rotate-1 { transform: rotate(1deg); }
.mx-rotate-n1 { transform: rotate(-1deg); }
.mx-rotate-2 { transform: rotate(2deg); }
.mx-rotate-n2 { transform: rotate(-2deg); }
.mx-relative { position: relative; }
.mx-absolute { position: absolute; }
.mx-inline-block { display: inline-block; }

/* Components */
.mx-marker-highlight {
  background:
    linear-gradient(
      104deg,
      rgba(191, 246, 33, 0) 0.9%,
      rgba(191, 246, 33, 1) 2.4%,
      rgba(191, 246, 33, 0.5) 5.8%,
      rgba(191, 246, 33, 1) 93%,
      rgba(191, 246, 33, 0.7) 96%,
      rgba(191, 246, 33, 0) 98%
    ),
    linear-gradient(183deg, rgba(191, 246, 33, 0) 0%, rgba(191, 246, 33, 0.3) 7.9%, rgba(191, 246, 33, 0) 15%);
  padding: 0 0.2em;
  border-radius: 2px;
  display: inline-block;
}

.mx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 900;
  text-decoration: none;
  border: 4px solid var(--c-brutal);
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  position: relative;
  z-index: 10;
  border-radius: 1rem;
  padding: 1.25rem 2.5rem;
  font-size: 1.25rem;
}
@media (min-width: 768px) {
  .mx-btn { font-size: 1.5rem; }
}
.mx-btn:active {
  transform: translate(4px, 4px) !important;
  box-shadow: 0 0 0 0 var(--c-brutal) !important;
}

.mx-btn-primary {
  background-color: #ff4500;
  color: #fff;
  box-shadow: var(--shadow-xl);
}
.mx-btn-primary:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(2px);
}

.mx-btn-secondary {
  background-color: var(--max-blue);
  color: #fff;
  box-shadow: var(--shadow-xl);
}
.mx-btn-secondary:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(2px);
}

.mx-btn-accent {
  background-color: var(--c-marker);
  color: var(--c-brutal);
  box-shadow: var(--shadow-lg);
}
.mx-btn-accent:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(2px);
}

.mx-btn-white {
  background-color: #fff;
  color: var(--c-brutal);
  box-shadow: var(--shadow-md);
  padding: 1rem 2rem;
  font-size: 1.125rem;
}
.mx-btn-white:hover {
  background-color: #f3f4f6;
  transform: translateY(2px);
  box-shadow: var(--shadow-sm);
}

.mx-card {
  border: 4px solid var(--c-brutal);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  background: #fff;
}

/* Landing specific */
.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  border-bottom: 4px solid var(--c-brutal);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 0 0 var(--c-brutal);
}

.logo {
  font-size: 24px;
  font-weight: 900;
  color: var(--c-brutal);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero {
  padding-top: 5rem;
  padding-bottom: 5rem;
  display: flex;
  flex-direction: column;
  gap: 4rem;
  align-items: center;
}
@media (min-width: 1024px) {
  .hero {
    flex-direction: row;
    align-items: stretch;
  }
}
.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Telegram Mockup for Landing */
.mockup-container {
  flex: 1;
  display: flex;
  justify-content: center;
  position: relative;
}

.phone-mockup {
  width: 340px;
  height: 650px;
  background: var(--tg-bg);
  border-radius: 40px;
  box-shadow: var(--shadow-xl);
  border: 8px solid var(--c-brutal);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: rotate(2deg);
  transition: transform 0.3s;
}
.phone-mockup:hover {
  transform: rotate(0deg);
}

.phone-header {
  background: #fff;
  padding: 40px 15px 15px;
  border-bottom: 2px solid var(--c-brutal);
  text-align: center;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.chat-area {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h100v100H0z" fill="%23E4E5E8"/><circle cx="50" cy="50" r="2" fill="%23d0d0d0"/></svg>');
}

.chat-area::-webkit-scrollbar {
  width: 6px;
}
.chat-area::-webkit-scrollbar-thumb {
  background: var(--c-brutal);
  border-radius: 4px;
}

.msg {
  padding: 12px;
  border-radius: 12px;
  max-width: 90%;
  font-size: 14px;
  line-height: 1.4;
  animation: fadeIn 0.3s ease-out forwards;
  border: 2px solid var(--c-brutal);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.msg.bot {
  background: var(--tg-msg-bg);
  border-bottom-left-radius: 2px;
  align-self: flex-start;
}

.msg.user {
  background: var(--tg-user-msg-bg);
  border-bottom-right-radius: 2px;
  align-self: flex-end;
}

.msg-text {
  margin-bottom: 8px;
  white-space: pre-line;
  font-weight: 500;
}

.inline-kbd {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kbd-row {
  display: flex;
  gap: 6px;
}

.kbd-btn {
  flex: 1;
  background: var(--tg-btn-bg);
  color: var(--tg-btn-text);
  border: 2px solid transparent;
  padding: 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.kbd-btn:hover {
  background: rgba(42, 171, 238, 0.2);
  transform: translateY(-1px);
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--tg-msg-bg);
  border-radius: 12px;
  border-bottom-left-radius: 2px;
  border: 2px solid var(--c-brutal);
  align-self: flex-start;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.2s ease-out;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--c-brutal);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

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

/* Stats Section */
.mx-stats-section {
  background-color: #fff;
  border-top: 4px dashed var(--c-brutal);
  border-bottom: 4px dashed var(--c-brutal);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.stat-number {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--max-blue);
  line-height: 1;
}
.stat-label {
  font-size: 1.125rem;
  font-weight: 700;
  color: #666;
}

/* Features grid */
.feature-icon-box {
  width: 4rem;
  height: 4rem;
  background: var(--c-marker);
  border: 3px solid var(--c-brutal);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transform: rotate(-3deg);
}

.footer {
  text-align: center;
  padding: 40px;
  color: #111;
  font-weight: 600;
  border-top: 4px solid var(--c-brutal);
  background: #fff;
}

.mx-tag {
  display: inline-block;
  border: 2px solid var(--c-brutal);
  background: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
}
