:root {
  --bg-main: #05020f;
  --bg-panel: rgba(16, 8, 32, 0.82);
  --line-soft: rgba(255, 127, 226, 0.14);
  --text-main: #fff7ff;
  --text-soft: #f2c3ff;
  --text-muted: rgba(242, 211, 255, 0.72);
  --accent-gold: #ff9ef3;
  --accent-pink: #ff4ea3;
  --accent-violet: #9f55ff;
  --bubble-user: linear-gradient(135deg, #ff4ea3, #9f55ff);
  --bubble-ai: rgba(255, 247, 255, 0.06);
  --shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-main: "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at top left, rgba(255, 78, 163, 0.22), transparent 28%),
    radial-gradient(circle at bottom right, rgba(159, 85, 255, 0.2), transparent 24%),
    linear-gradient(180deg, #090311 0%, #05020f 58%, #030109 100%);
  color: var(--text-main);
  font-family: var(--font-main);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.aurora {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.52;
  pointer-events: none;
}

.aurora-left {
  top: -3rem;
  left: -5rem;
  background: rgba(255, 78, 163, 0.2);
}

.aurora-right {
  right: -5rem;
  bottom: 3rem;
  background: rgba(159, 85, 255, 0.18);
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: 1rem;
}

.landing-screen {
  display: grid;
  gap: 1rem;
  width: min(100%, 1360px);
  margin: 0 auto;
}

.hero-card,
.entry-card,
.feature-card,
.chat-screen {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  background: var(--bg-panel);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.2rem;
  min-height: 72vh;
  padding: 1.25rem;
}

.brand-kicker,
.chat-label,
.preview-label {
  color: var(--accent-gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.brand-logo {
  width: 108px;
  height: 108px;
  object-fit: contain;
  border-radius: 24px;
  background: #000;
}

.brand-name {
  margin-top: 0.18rem;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
}

.brand-tagline {
  margin-top: 0.35rem;
  max-width: 34ch;
  color: var(--text-muted);
  line-height: 1.6;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 0.8rem;
  font-size: clamp(2.8rem, 8vw, 6rem);
  line-height: 0.92;
}

.hero-copy-block {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.4rem;
  padding: 0.4rem;
}

.hero-copy {
  max-width: 52ch;
  margin-top: 1rem;
  color: var(--text-soft);
  font-size: 1.02rem;
  line-height: 1.8;
}

.hero-subcopy {
  max-width: 52ch;
  margin-top: 0.9rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.primary-btn,
.secondary-btn,
.send-btn,
.ghost-btn,
.tab-btn {
  border: 0;
  cursor: pointer;
}

.primary-btn,
.send-btn {
  min-height: 54px;
  padding: 0.9rem 1.25rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff5bb0, #9f55ff);
  color: #fff7ff;
  font-weight: 700;
  box-shadow: 0 18px 32px rgba(159, 85, 255, 0.3);
}

.secondary-btn,
.ghost-btn {
  min-height: 54px;
  padding: 0.9rem 1.15rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.feature-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.trust-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.trust-line span {
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 127, 226, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}

.hero-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100%;
}

.preview-glow {
  position: absolute;
  inset: 12% 10%;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 78, 163, 0.25), rgba(159, 85, 255, 0.16));
  filter: blur(10px);
}

.preview-card {
  position: relative;
  width: min(100%, 420px);
  display: grid;
  gap: 0.8rem;
  padding: 1.2rem;
  border-radius: 28px;
  background: rgba(18, 6, 13, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.preview-bubble {
  max-width: 88%;
  padding: 0.9rem 1rem;
  border-radius: 20px;
  line-height: 1.5;
}

.preview-bubble.ai {
  background: rgba(255, 255, 255, 0.06);
  border-bottom-left-radius: 6px;
}

.preview-bubble.user {
  justify-self: end;
  background: var(--bubble-user);
  color: #2a0914;
  border-bottom-right-radius: 6px;
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.companion-showcase {
  display: grid;
  gap: 1rem;
}

.companion-card {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 1rem;
  align-items: start;
  padding: 1.2rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-soft);
  background: var(--bg-panel);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.companion-copy {
  padding: 0.4rem 0.2rem 0.4rem 0;
}

.companion-copy h2 {
  margin-top: 0.35rem;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.gallery-item {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(5, 2, 7, 0.88);
  backdrop-filter: blur(10px);
}

.lightbox-card {
  position: relative;
  width: min(100%, 1100px);
  max-height: calc(100vh - 2rem);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-soft);
  background: rgba(19, 7, 13, 0.96);
  overflow: hidden;
}

.lightbox-scroll {
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1rem;
  text-align: center;
}

.lightbox-scroll img {
  width: auto;
  max-width: 100%;
  height: auto;
  display: inline-block;
  border-radius: 20px;
}

.duo-grid {
  grid-template-columns: 1.35fr 0.85fr;
}

.wide-card {
  padding: 1.2rem;
}

.wide-card h2 {
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  margin-top: 0.35rem;
  font-weight: 600;
}

.human-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.human-card h2 {
  margin-top: 0.35rem;
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  font-weight: 600;
}

.feature-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-soft);
  line-height: 1.75;
}

.compact-list {
  margin-top: 0.7rem;
}

.bottom-cta {
  display: grid;
  place-items: center;
  padding: 0.4rem 0 0.8rem;
}

.bottom-cta-card {
  width: min(100%, 760px);
  padding: 1.2rem;
  text-align: center;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-soft);
  background: var(--bg-panel);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.bottom-cta-line {
  margin-top: 0.45rem;
  color: var(--text-soft);
  line-height: 1.7;
}

.bottom-cta-card .hero-actions {
  justify-content: center;
  margin-top: 1rem;
}

.feature-card h2,
.entry-header h2 {
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.feature-card p,
.entry-copy,
.privacy-note,
.status-text {
  margin-top: 0.5rem;
  color: var(--text-soft);
  line-height: 1.7;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(8, 3, 8, 0.62);
  backdrop-filter: blur(14px);
  overflow-y: auto;
}

.modal-card {
  position: relative;
  width: min(100%, 560px);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.2rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-soft);
  background: rgba(28, 10, 19, 0.94);
  box-shadow: var(--shadow);
}

.id-card {
  text-align: center;
}

.user-id-box {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.user-id-box strong {
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  letter-spacing: 0.08em;
  color: var(--accent-gold);
}

.id-actions {
  justify-content: center;
  margin-top: 1rem;
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-size: 1.4rem;
}

.tab-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn {
  min-height: 46px;
  border-radius: 999px;
  color: var(--text-soft);
  background: transparent;
}

.tab-btn.active {
  background: linear-gradient(135deg, #ff7cc3, #b16bff);
  color: #fff7ff;
}

.entry-form {
  display: none;
  gap: 0.95rem;
  margin-top: 1.1rem;
}

.entry-form.active {
  display: grid;
}

label {
  display: grid;
  gap: 0.45rem;
}

label span {
  color: var(--text-soft);
  font-size: 0.95rem;
}

input,
select {
  width: 100%;
  min-height: 54px;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  outline: none;
}

input::placeholder {
  color: rgba(255, 243, 246, 0.46);
}

input:focus,
select:focus {
  border-color: rgba(255, 78, 163, 0.7);
  box-shadow: 0 0 0 4px rgba(159, 85, 255, 0.14);
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.choice-pill {
  position: relative;
}

.choice-pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.choice-pill span {
  display: grid;
  place-items: center;
  min-height: 54px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.choice-pill input:checked + span {
  background: rgba(255, 78, 163, 0.18);
  border-color: rgba(159, 85, 255, 0.65);
}

.status-text:empty {
  display: none;
}

.chat-screen {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: calc(100vh - 2rem);
  height: calc(100vh - 2rem);
  overflow: hidden;
}

.chat-watermark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.chat-watermark img {
  width: min(52vw, 560px);
  max-width: 78%;
  opacity: 0.12;
  filter: saturate(1.05);
}

body.chat-open .app-shell {
  max-width: none;
  height: 100vh;
  padding: 0;
}

body.modal-open {
  overflow: hidden;
}

body.chat-open {
  overflow: hidden;
}

body.lightbox-open {
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 3, 20, 0.94);
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}

.chat-profile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.chat-profile > div {
  min-width: 0;
}

.chat-avatar-wrap {
  position: relative;
}

.chat-avatar {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.chat-status-dot {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #43d66b;
  border: 2px solid rgba(10, 3, 19, 0.95);
  box-shadow: 0 0 10px rgba(67, 214, 107, 0.45);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
}

.user-chip {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.chip-label {
  display: block;
  color: var(--text-soft);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ghost-btn {
  min-height: 42px;
}

.icon-btn {
  width: 42px;
  min-width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.chat-thread {
  padding: 1.25rem;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  position: relative;
  z-index: 0;
  -webkit-overflow-scrolling: touch;
}

.typing-indicator {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0 1.25rem 0.8rem;
  position: relative;
  z-index: 18;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 158, 243, 0.95);
  animation: typingPulse 1s infinite ease-in-out;
}

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

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

.message {
  max-width: min(62ch, 76%);
}

.message.ai {
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
}

.message-bubble {
  padding: 0.95rem 1rem;
  border-radius: 22px;
  line-height: 1.65;
  word-break: break-word;
}

.message.ai .message-bubble {
  background: var(--bubble-ai);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom-left-radius: 8px;
}

.message.user .message-bubble {
  background: var(--bubble-user);
  color: #2a0914;
  border-bottom-right-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-end;
}

.message-meta {
  font-size: 0.78rem;
  color: rgba(42, 9, 20, 0.7);
  text-align: right;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--line-soft);
  background: rgba(8, 3, 20, 0.94);
  position: relative;
  z-index: 20;
  align-items: center;
  flex-shrink: 0;
}

#chat-input {
  min-width: 0;
}

.chat-form .send-btn {
  min-height: 48px;
  padding: 0.8rem 1rem;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

@keyframes typingPulse {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 1024px) {
  .hero-panel,
  .feature-band,
  .duo-grid,
  .companion-card {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .message {
    max-width: 84%;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 0;
  }

  .hero-panel,
  .feature-card,
  .chat-screen {
    border-radius: 0;
  }

  .chat-screen {
    min-height: 100svh;
    height: 100svh;
  }

  .chat-header {
    position: sticky;
    top: 0;
    align-items: center;
    gap: 0.55rem;
    padding: calc(env(safe-area-inset-top, 0px) + 0.55rem) 0.75rem 0.55rem;
    min-height: calc(env(safe-area-inset-top, 0px) + 4.9rem);
    background: #090311;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
  }

  .chat-profile {
    min-width: 0;
    gap: 0.65rem;
  }

  .chat-profile > div {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
  }

  .chat-profile h2,
  .chat-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat-profile h2 {
    font-size: 1.2rem;
    line-height: 1.1;
  }

  .chat-label {
    font-size: 0.68rem;
  }

  .chat-avatar {
    width: 42px;
    height: 42px;
  }

  .chat-status-dot {
    width: 10px;
    height: 10px;
  }

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

  .gallery-grid img {
    min-height: 300px;
  }

  .header-actions {
    align-items: center;
    flex-direction: row;
    gap: 0.35rem;
  }

  .user-chip {
    padding: 0.35rem 0.5rem;
    max-width: 108px;
  }

  .chip-label {
    font-size: 0.58rem;
  }

  .user-chip strong {
    font-size: 0.78rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .icon-btn {
    width: 38px;
    min-width: 38px;
  }

  .chat-thread {
    padding: 0.85rem 0.75rem;
  }

  .typing-indicator {
    position: sticky;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 4.2rem);
    padding: 0 0.75rem 0.45rem;
    background: linear-gradient(180deg, rgba(9, 3, 17, 0), rgba(9, 3, 17, 0.92));
  }

  .chat-form {
    position: sticky;
    bottom: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem calc(env(safe-area-inset-bottom, 0px) + 0.65rem);
    background: #090311;
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.28);
  }

  .message {
    max-width: 90%;
  }

  .chat-form .send-btn {
    padding-inline: 0.9rem;
  }

  .chat-watermark img {
    width: min(78vw, 340px);
    opacity: 0.1;
  }

  .modal-backdrop {
    place-items: start center;
    padding: 0.7rem;
  }

  .modal-card {
    width: 100%;
    max-height: calc(100vh - 1.4rem);
    padding: 1rem;
  }
}
