:root {
  --bg: #0b0b0b;
  --surface: #121212;
  --surface-2: #181818;
  --line: #2a2a2a;
  --line-soft: #3a3a3a;
  --text: #f5f5f5;
  --muted: #b3b3b3;
  --accent: #ffffff;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shadow-lg: 0 20px 80px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #171717 0%, var(--bg) 45%);
  color: var(--text);
  padding: 30px 18px 60px;
  overflow-x: hidden;
}

.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.15;
  background-image: radial-gradient(#fff 0.4px, transparent 0.4px);
  background-size: 2px 2px;
}

.page {
  width: min(1060px, 100%);
  margin: 0 auto;
}

.hero {
  text-align: center;
  margin-bottom: 26px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: #e6e6e6;
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 14px auto 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 30px;
}

.features article {
  background: linear-gradient(180deg, #171717, #131313);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.features h2 {
  font-size: 17px;
  margin: 0 0 8px;
}

.features p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.chat-shell {
  background: linear-gradient(180deg, #161616, #101010 65%);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  background: #111;
}

.chat-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-title-wrap strong {
  margin-left: 4px;
  font-size: 14px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.dot-white {
  background: #ececec;
}

.dot-gray {
  background: #b4b4b4;
}

.dot-dark {
  background: #5a5a5a;
}

.chat-model {
  font-size: 12px;
  color: #9f9f9f;
  letter-spacing: 0.02em;
}

.chat-messages {
  height: min(64vh, 640px);
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  opacity: 0;
  transform: translateY(10px);
  animation: message-in 420ms ease forwards;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #d2d2d2;
  background: #1a1a1a;
  flex-shrink: 0;
}

.msg-user .avatar {
  background: #efefef;
  color: #101010;
  border-color: #cfcfcf;
}

.bubble {
  max-width: min(75ch, 80%);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: #f1f1f1;
  line-height: 1.45;
}

.msg-user {
  justify-content: flex-end;
}

.msg-user .bubble {
  order: -1;
  background: #f3f3f3;
  color: #111;
  border-color: #dedede;
}

.msg-thinking .bubble {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  display: inline-block;
  background: #dedede;
  animation: blink 1s infinite ease-in-out;
}

.typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing i:nth-child(3) {
  animation-delay: 0.3s;
}

.bubble-image {
  width: min(860px, 100%);
}

.image-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #2f2f2f;
  background: #090909;
}

.image-frame img {
  width: 100%;
  display: block;
  transform: scale(1.01);
  transition: filter 0.55s ease, transform 0.55s ease;
}

.image-frame.loading img {
  filter: blur(11px) grayscale(0.4) brightness(0.7);
  transform: scale(1.05);
}

.render-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  color: #efefef;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 11px;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.58),
    rgba(0, 0, 0, 0.3) 40%,
    rgba(0, 0, 0, 0.6)
  );
  transition: opacity 300ms ease;
}

.scanner {
  width: min(80vw, 420px);
  height: 2px;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  animation: scan 1200ms linear infinite;
}

.image-frame:not(.loading) .render-overlay {
  opacity: 0;
  pointer-events: none;
}

.image-caption {
  margin: 10px 0 0;
  color: #c7c7c7;
  font-size: 13px;
}

.chat-input-wrap {
  border-top: 1px solid var(--line);
  padding: 12px;
  background: #101010;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.chat-input-wrap textarea {
  border: 1px solid var(--line-soft);
  background: #141414;
  color: var(--text);
  border-radius: 12px;
  padding: 14px 14px;
  resize: none;
  min-height: 50px;
  max-height: 160px;
  line-height: 1.4;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.chat-input-wrap textarea:focus {
  border-color: #7f7f7f;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.chat-input-wrap button {
  border: 1px solid #d6d6d6;
  background: #f3f3f3;
  color: #101010;
  border-radius: 12px;
  min-width: 150px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.chat-input-wrap button:hover {
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.22);
}

.chat-input-wrap button:active {
  transform: translateY(1px) scale(0.99);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes blink {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.25;
  }
  40% {
    transform: translateY(-2px);
    opacity: 1;
  }
}

@keyframes scan {
  0% {
    transform: translateX(-20%);
    opacity: 0.2;
  }
  45% {
    opacity: 1;
  }
  100% {
    transform: translateX(20%);
    opacity: 0.2;
  }
}

@keyframes message-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .chat-model {
    display: none;
  }
}

@media (max-width: 640px) {
  body {
    padding: 16px 10px 40px;
  }

  .hero p {
    font-size: 14px;
  }

  .chat-input-wrap {
    grid-template-columns: 1fr;
  }

  .chat-input-wrap button {
    width: 100%;
    min-width: 0;
  }

  .bubble {
    max-width: 100%;
  }
}
