:root {
  --bg: #070708;
  --gray: #808285;
  --gray-soft: #a3a5a8;
  --orange: #ee7d11;
  --text: #f2f2f3;
  --line: rgba(128, 130, 133, 0.28);
  --display: "Sora", sans-serif;
  --body: "IBM Plex Sans", sans-serif;
}

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  color: var(--text);
  background: var(--bg);
  font-family: var(--body);
}

.hero {
  height: 100svh;
  max-height: 100svh;
  overflow: clip;
  display: grid;
  grid-template-rows: auto 1fr;
  position: relative;
  contain: paint;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(238, 125, 17, 0.2), transparent 58%),
    radial-gradient(ellipse 45% 40% at 88% 78%, rgba(128, 130, 133, 0.14), transparent 60%),
    radial-gradient(ellipse 40% 35% at 8% 72%, rgba(238, 125, 17, 0.07), transparent 55%),
    linear-gradient(180deg, #0b0b0d 0%, #070708 48%, #050505 100%);
}

.top {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  width: min(148px, 38vw);
  height: auto;
  display: block;
}

.lang {
  display: inline-flex;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  background: rgba(16, 17, 20, 0.85);
  flex: 0 0 auto;
}

.lang button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--gray);
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.lang button.is-active {
  color: #070708;
  background: var(--orange);
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem 1.25rem 2.5rem;
}

.logo {
  display: none;
}

.copy {
  width: min(34rem, 100%);
  animation: rise 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.copy.is-switching {
  animation: fade-swap 0.3s ease;
}

h1 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.lead {
  margin: 0 auto 1.5rem;
  max-width: 28rem;
  color: var(--gray-soft);
  font-size: clamp(0.98rem, 2.2vw, 1.1rem);
  line-height: 1.55;
}

.contacts {
  display: grid;
  gap: 0.7rem;
  justify-items: center;
}

.contact {
  display: grid;
  gap: 0.15rem;
  text-decoration: none;
  color: inherit;
  justify-items: center;
}

.contact span {
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray);
}

.contact strong {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(0.98rem, 2.3vw, 1.12rem);
  color: var(--orange);
}

/* SEO: in DOM for crawlers, not painted for users */
.seo-crawl {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 9999;
  width: min(380px, calc(100vw - 1.5rem));
  height: min(560px, calc(100svh - 5.5rem));
  pointer-events: none;
}

.chat-fab {
  position: absolute;
  right: 0;
  bottom: 0;
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.05rem;
  background: var(--orange);
  color: #1a120c;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: 0 14px 34px rgba(238, 125, 17, 0.28);
  pointer-events: auto;
  transition: transform 0.22s ease, opacity 0.22s ease, visibility 0.22s ease;
}

.chat-fab.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(0.96);
}

.chat-fab:hover {
  transform: translateY(-2px);
}

.chat-fab-icon {
  display: grid;
  place-items: center;
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: #101218;
  border: 1px solid var(--line);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  overflow: hidden;
  transform-origin: bottom right;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-panel[hidden] {
  display: grid !important;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  pointer-events: none;
}

.chat-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #161a22, #12151c);
}

.chat-avatar {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  background: rgba(238, 125, 17, 0.16);
  color: var(--orange);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-self: flex-start;
  max-width: 100%;
  animation: bubble-in 0.22s ease;
}

.choice-btn {
  appearance: none;
  border: 1px solid rgba(238, 125, 17, 0.35);
  background: rgba(238, 125, 17, 0.08);
  color: #ffd7a8;
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.choice-btn:hover {
  background: rgba(238, 125, 17, 0.16);
  border-color: rgba(238, 125, 17, 0.55);
}

.chat-head-text {
  display: grid;
  gap: 0.1rem;
}

.chat-head-text strong {
  font-family: var(--display);
  font-size: 0.92rem;
}

.chat-head-text span {
  color: #78c59a;
  font-size: 0.72rem;
}

.chat-x {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--gray-soft);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.chat-stream {
  overflow: auto;
  padding: 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  scroll-behavior: smooth;
}

.bubble {
  max-width: 88%;
  padding: 0.7rem 0.85rem;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  animation: bubble-in 0.22s ease;
}

.bubble.bot {
  align-self: flex-start;
  background: #1a1f29;
  color: #e8edf5;
  border: 1px solid rgba(128, 130, 133, 0.2);
}

.bubble.user {
  align-self: flex-end;
  background: rgba(238, 125, 17, 0.16);
  color: #ffe6c8;
  border: 1px solid rgba(238, 125, 17, 0.28);
}

.bubble.typing::after {
  content: "▍
  animation: caret 0.9s steps(1) infinite;
}

.chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  padding: 0.7rem 0.75rem;
  border-top: 1px solid var(--line);
  background: #0d1016;
}

.chat-composer input {
  width: 100%;
  border: 1px solid var(--line);
  background: #0a0c10;
  color: var(--text);
  padding: 0.7rem 0.75rem;
  font: inherit;
  font-size: 16px;
}

.chat-composer input:disabled {
  opacity: 0.55;
}

.chat-composer button {
  appearance: none;
  border: 0;
  background: var(--orange);
  color: #1a120c;
  font-family: var(--display);
  font-weight: 600;
  padding: 0 0.95rem;
  cursor: pointer;
}

.chat-composer button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.choice-btn-skip {
  border-color: rgba(128, 130, 133, 0.4);
  background: rgba(128, 130, 133, 0.08);
  color: #c5c8cc;
}

.choice-btn-skip:hover {
  border-color: rgba(128, 130, 133, 0.65);
  background: rgba(128, 130, 133, 0.14);
}

.chat-skip {
  appearance: none;
  border: 1px solid var(--line);
  background: #0d1016;
  color: var(--gray-soft);
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.55rem 0.85rem;
  margin: 0 0.75rem 0.75rem auto;
  cursor: pointer;
  display: block;
  width: fit-content;
}

.chat-skip:hover {
  color: var(--text);
  border-color: rgba(128, 130, 133, 0.55);
}

.chat-skip[hidden] {
  display: none !important;
}

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

@keyframes fade-swap {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes caret {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo,
  .copy,
  .copy.is-switching,
  .chat-panel,
  .bubble {
    animation: none !important;
  }
}
