:root {
  --panel: rgba(17, 25, 35, 0.82);
  --panel-border: rgba(255, 255, 255, 0.09);
  --text: #f5f7fa;
  --muted: #9eabb9;
  --accent: #72f5c5;
  --eye: #73ff00;
  --radius: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(54, 106, 120, 0.22), transparent 38%),
    linear-gradient(145deg, #06090d 0%, #0a1017 55%, #06090d 100%);
  overflow-x: hidden;
}

button, input { font: inherit; }

.stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(114, 245, 197, 0.38);
  border-radius: 13px;
  color: var(--accent);
  background: rgba(114, 245, 197, 0.07);
  box-shadow: inset 0 0 20px rgba(114, 245, 197, 0.06);
  font-weight: 800;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 0.98rem; }
.brand small { color: var(--muted); font-size: 0.69rem; margin-top: 1px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 13px var(--accent);
}

.hero {
  position: relative;
  width: min(960px, calc(100% - 32px));
  margin: auto;
  padding: 38px 0 80px;
  text-align: center;
  isolation: isolate;
}

.ambient {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(55px);
  opacity: 0.6;
}

.ambient-one {
  width: 290px;
  height: 290px;
  left: 12%;
  top: 9%;
  background: rgba(24, 148, 125, 0.19);
}

.ambient-two {
  width: 250px;
  height: 250px;
  right: 12%;
  top: 25%;
  background: rgba(63, 106, 171, 0.16);
}

.character-wrap {
  position: relative;
  width: 220px;
  margin: 12px auto 0;
  padding-top: 62px;
}

.speech-bubble {
  position: absolute;
  top: 0;
  left: 50%;
  width: max-content;
  max-width: min(410px, 86vw);
  transform: translateX(-50%);
  padding: 13px 18px;
  border: 1px solid var(--panel-border);
  border-radius: 18px 18px 18px 5px;
  color: #dffdf2;
  background: rgba(19, 31, 39, 0.94);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.3);
  font-size: 0.93rem;
  line-height: 1.45;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  left: 48px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  border-right: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  background: rgba(19, 31, 39, 0.94);
}

.droid-character {
  position: relative;
  width: 220px;
  height: 245px;
  margin: 0 auto;
  animation: hover 5s ease-in-out infinite;
}

.halo {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  filter: blur(24px);
  pointer-events: none;
}
.halo-1 { width: 220px; height: 220px; background: rgba(114, 245, 197, 0.12); }
.halo-2 { width: 295px; height: 220px; background: rgba(78, 143, 255, 0.08); }

.head-shell {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 180px;
  height: 129px;
  transform: translateX(-50%);
  border-radius: 66px;
  background:
    linear-gradient(180deg, #ffffff 0%, #eff3f7 48%, #dbe2e9 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.95),
    inset 0 -10px 18px rgba(155, 165, 176, 0.18),
    0 26px 55px rgba(0,0,0,0.42),
    0 0 40px rgba(255,255,255,0.05);
}

.head-shell::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 56px;
  border: 10px solid rgba(255,255,255,0.92);
}

.screen {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 132px;
  height: 74px;
  transform: translate(-50%, -50%);
  border-radius: 28px;
  background:
    linear-gradient(180deg, #060a0d 0%, #070b10 100%);
  box-shadow:
    inset 0 8px 18px rgba(255,255,255,0.04),
    inset 0 -12px 24px rgba(0,0,0,0.38),
    0 0 0 1px rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 16px 24px 13px;
}

.eyes {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  height: 54px;
}

.eye {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #8eff00 0%, #73ff00 68%, #45cf00 100%);
  box-shadow: 0 0 22px rgba(115,255,0,0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    height 0.12s ease,
    border-radius 0.12s ease,
    box-shadow 0.12s ease,
    opacity 0.12s ease;
  overflow: hidden;
}

.pupil {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #05090c;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.mouth-bar {
  width: 56px;
  height: 7px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(115, 245, 197, 0.18);
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.neck-core {
  position: absolute;
  left: 50%;
  top: 128px;
  width: 36px;
  height: 36px;
  transform: translateX(-50%);
  border-radius: 14px;
  background: linear-gradient(180deg, #141c24 0%, #0e1319 100%);
  box-shadow:
    0 18px 34px rgba(0,0,0,0.3),
    inset 0 0 0 1px rgba(255,255,255,0.04);
  display: grid;
  place-items: center;
}

.core-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(114,245,197,0.65);
}

.body-shell {
  position: absolute;
  left: 50%;
  top: 154px;
  width: 96px;
  height: 70px;
  transform: translateX(-50%);
  border-radius: 27px 27px 38px 38px;
  background: linear-gradient(180deg, #1b242d 0%, #0e1319 100%);
  box-shadow:
    0 24px 45px rgba(0,0,0,0.34),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

.body-panel {
  position: absolute;
  left: 50%;
  top: 20px;
  width: 86px;
  height: 40px;
  transform: translateX(-50%);
  border-radius: 18px;
  background: linear-gradient(180deg, #0a1015 0%, #121922 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.shadow {
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 120px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  filter: blur(10px);
  animation: shadow 5s ease-in-out infinite;
}

.droid-character.is-squinting .eye {
  height: 14px;
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(115,255,0,0.28);
}

.droid-character.is-squinting .pupil {
  opacity: 0.08;
  transform: scale(0.65);
}

.droid-character.is-blinking .eye {
  height: 4px;
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(115,255,0,0.15);
}

.droid-character.is-blinking .pupil {
  opacity: 0;
  transform: scale(0.2);
}

.droid-character.is-talking .mouth-bar {
  opacity: 1;
  transform: scaleX(1.04);
  box-shadow: 0 0 14px rgba(115,245,197,0.24);
  animation: mouthPulse 0.24s ease-in-out infinite alternate;
}

.droid-character.is-talking .halo-1 {
  animation: pulse 1.15s ease-out infinite;
}

.droid-character.is-talking .halo-2 {
  animation: pulse 1.15s ease-out .25s infinite;
}

.intro { margin-top: 0; }

.lead {
  max-width: 620px;
  margin: 18px auto 28px;
  color: var(--muted);
  font-size: clamp(1rem, 2.1vw, 1.14rem);
  line-height: 1.7;
}

.chat-box {
  width: min(710px, 100%);
  margin: 0 auto;
  padding: 8px;
  display: flex;
  gap: 8px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0,0,0,0.34);
  backdrop-filter: blur(14px);
}

.chat-box:focus-within {
  border-color: rgba(114, 245, 197, 0.37);
  box-shadow: 0 24px 75px rgba(0,0,0,0.38), 0 0 0 4px rgba(114,245,197,0.05);
}

.chat-box input {
  min-width: 0;
  flex: 1;
  padding: 13px 16px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.chat-box input::placeholder { color: #74818d; }

.chat-box button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px;
  border: 0;
  border-radius: 17px;
  color: #06110d;
  background: var(--accent);
  cursor: pointer;
  font-weight: 750;
  transition: transform 0.18s ease, background 0.18s ease;
}

.chat-box button:hover {
  transform: translateY(-1px);
  background: #8affd4;
}

.chat-box button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.demo-note {
  margin: 15px 0 0;
  color: #64717d;
  font-size: 0.75rem;
}

.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 hover {
  0%, 100% { transform: translateY(0) rotate(-0.45deg); }
  50% { transform: translateY(-10px) rotate(0.45deg); }
}

@keyframes shadow {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.6; }
  50% { transform: translateX(-50%) scale(0.82); opacity: 0.38; }
}

@keyframes pulse {
  0% { transform: translate(-50%, -50%) scale(0.96); opacity: 0.35; }
  100% { transform: translate(-50%, -50%) scale(1.08); opacity: 0.12; }
}

@keyframes mouthPulse {
  from { opacity: .22; }
  to { opacity: .75; }
}

@media (max-width: 720px) {
  .topbar {
    width: min(100% - 28px, 1180px);
    padding: 17px 0;
  }

  .status { font-size: 0; }
  .status i { width: 9px; height: 9px; }

  .hero {
    width: min(100% - 22px, 960px);
    padding-top: 18px;
  }

  .character-wrap {
    width: min(100%, 205px);
    transform: scale(0.93);
    transform-origin: top center;
    margin-bottom: 0;
  }

  .droid-character {
    width: 205px;
    height: 230px;
  }

  .head-shell {
    width: 168px;
    height: 122px;
  }

  .screen {
    width: 124px;
    height: 70px;
  }

  .eye {
    width: 35px;
    height: 35px;
  }

  .lead { margin-bottom: 24px; }

  .chat-box {
    border-radius: 20px;
  }

  .chat-box button span { display: none; }
  .chat-box button { padding: 13px 15px; }
}


.chat-box.is-busy {
  opacity: 0.78;
}

.chat-box button:disabled,
.chat-box input:disabled {
  cursor: wait;
}

.chat-box button:disabled {
  transform: none;
  opacity: 0.62;
}

.demo-note.error {
  color: #ff8f8f;
}

.demo-note.success {
  color: #72f5c5;
}


/* v7.1 düzeltmeler */
.character-wrap {
  padding-top: 112px !important;
  margin: 8px auto 8px !important;
}

.speech-bubble {
  top: 4px !important;
  z-index: 20 !important;
  max-width: min(460px, 92vw) !important;
}

.speech-bubble::after {
  left: 50% !important;
  transform: translateX(-50%) rotate(45deg) !important;
}

.droid-character {
  width: 220px !important;
  height: 170px !important;
  z-index: 5;
}

.head-shell {
  top: 4px !important;
  width: 180px !important;
  height: 129px !important;
}

.screen {
  width: 132px !important;
  height: 74px !important;
  gap: 8px !important;
  padding: 12px 16px 10px !important;
}

.eyes {
  gap: 18px !important;
  height: 44px !important;
}

.eye {
  width: 38px !important;
  height: 38px !important;
}

.pupil {
  width: 14px !important;
  height: 14px !important;
}

.mouth-bar {
  width: 44px !important;
}

.shadow {
  width: 96px !important;
  bottom: 8px !important;
}

.neck-core,
.body-shell,
.body-panel {
  display: none !important;
}

.intro,
.lead {
  display: none !important;
}

.hero {
  padding-top: 24px !important;
}

.demo-note {
  margin-top: 10px !important;
}

@media (max-width: 720px) {
  .character-wrap {
    width: min(100%, 210px) !important;
    padding-top: 108px !important;
  }
  .speech-bubble {
    max-width: min(360px, 94vw) !important;
    font-size: 0.88rem !important;
  }
  .droid-character {
    width: 205px !important;
    height: 160px !important;
  }
  .head-shell {
    width: 168px !important;
    height: 122px !important;
  }
  .screen {
    width: 124px !important;
    height: 70px !important;
  }
  .eye {
    width: 35px !important;
    height: 35px !important;
  }
}


/* v7.3: sabit balon yüksekliği ve dahili kaydırma */
.speech-bubble {
  width: min(460px, 92vw) !important;
  max-width: min(460px, 92vw) !important;
  max-height: 170px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(114, 245, 197, 0.5) rgba(255, 255, 255, 0.05);
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

.speech-bubble::-webkit-scrollbar {
  width: 7px;
}

.speech-bubble::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

.speech-bubble::-webkit-scrollbar-thumb {
  background: rgba(114, 245, 197, 0.42);
  border-radius: 10px;
}

.speech-bubble::-webkit-scrollbar-thumb:hover {
  background: rgba(114, 245, 197, 0.68);
}

@media (max-width: 720px) {
  .speech-bubble {
    width: min(350px, 94vw) !important;
    max-width: min(350px, 94vw) !important;
    max-height: 145px !important;
  }
}


/* v7.6: masaüstü sohbet balonu 70px yukarı */
.speech-bubble {
  top: -70px !important;
}

@media (max-width: 720px) {
  .speech-bubble {
    top: -52px !important;
  }
}
