:root {
  --orange: #f58220;
  --teal: #007d8a;
  --ink: #172136;
  --paper: #f8f4ee;
  --line: rgba(23, 33, 54, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

.ai-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(90deg, rgba(23, 33, 54, 0.9), rgba(23, 33, 54, 0.54)),
    url("/assets/images/frontend/banner/citymax-banner.jpg") center / cover;
}

.topbar {
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(18px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.brand img {
  width: min(260px, 54vw);
  height: auto;
  display: block;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topnav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  padding: 12px 14px;
}

.topnav a:hover {
  color: var(--teal);
}

.stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(340px, 1fr);
  grid-template-rows: auto auto 1fr;
  gap: 22px clamp(28px, 5vw, 76px);
  align-items: center;
  padding: clamp(22px, 5vw, 72px);
}

.stage-copy {
  color: #fff;
  align-self: end;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--orange);
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(46px, 8vw, 92px);
  line-height: 0.95;
  letter-spacing: 0;
}

.intro {
  max-width: 560px;
  margin: 18px 0 0;
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

.security-warning {
  max-width: 560px;
  margin-top: 18px;
  padding: 12px 14px;
  background: rgba(245, 130, 32, 0.14);
  border: 1px solid rgba(245, 130, 32, 0.55);
  color: #fff;
  font-weight: 700;
}

.receptionist {
  grid-row: span 3;
  justify-self: center;
  width: min(560px, 100%);
}

.portrait-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.75);
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
  transform-origin: 50% 65%;
}

.portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: 50% 48%;
  animation: idlePortrait 5.8s ease-in-out infinite;
  will-change: transform;
}

.voice-ring {
  position: absolute;
  inset: 18px;
  border: 4px solid rgba(245, 130, 32, 0);
  pointer-events: none;
  z-index: 4;
}

.mouth {
  position: absolute;
  left: 51.15%;
  top: 35.55%;
  width: 5.2%;
  height: 0.95%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(45, 11, 11, 0.88);
  box-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -2px 0 rgba(0, 0, 0, 0.22);
  opacity: 0;
  z-index: 5;
  will-change: width, height, opacity;
}

.blink {
  position: absolute;
  top: 25.25%;
  width: 6.2%;
  height: 2.15%;
  border-radius: 999px;
  background: rgba(184, 117, 76, 0.84);
  transform: scaleY(0);
  transform-origin: center;
  animation: blink 5.2s infinite;
  z-index: 5;
  pointer-events: none;
}

.blink-left {
  left: 43.4%;
}

.blink-right {
  left: 54.2%;
  animation-delay: 0.03s;
}

.receptionist.is-listening .voice-ring {
  border-color: rgba(0, 125, 138, 0.88);
  animation: pulse 1.15s infinite;
}

.receptionist.is-listening .portrait {
  animation: listenPortrait 2.8s ease-in-out infinite;
}

.receptionist.is-speaking .voice-ring {
  border-color: rgba(245, 130, 32, 0.92);
  animation: pulse 0.72s infinite;
}

.receptionist.is-speaking .portrait {
  animation: speakPortrait 1.05s ease-in-out infinite;
}

.receptionist.is-speaking .mouth {
  opacity: 0.72;
  animation: talk 0.18s infinite;
}

.receptionist.is-speaking.mouth-a .mouth {
  width: 5.9%;
  height: 2.3%;
  border-radius: 42% 42% 52% 52%;
}

.receptionist.is-speaking.mouth-e .mouth {
  width: 7.4%;
  height: 1.55%;
  border-radius: 999px;
}

.receptionist.is-speaking.mouth-o .mouth {
  width: 4.6%;
  height: 2.55%;
  border-radius: 50%;
}

.receptionist.is-thinking .portrait {
  animation: thinkPortrait 2.2s ease-in-out infinite;
}

.status-panel,
.voice-log {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
}

.status-panel {
  margin-top: 16px;
  padding: 14px 16px;
}

.status-label,
.voice-log span {
  display: block;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-text {
  font-size: 20px;
  font-weight: 800;
}

.control-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

button {
  min-height: 52px;
  border: 0;
  padding: 0 22px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.primary-control {
  background: var(--orange);
  color: #fff;
}

.secondary-control {
  background: #fff;
  color: var(--ink);
}

.voice-log {
  align-self: start;
  display: grid;
  gap: 1px;
  width: 100%;
  max-width: 690px;
}

.voice-log > div {
  padding: 15px 16px;
}

.voice-log p {
  margin: 0;
  line-height: 1.5;
  font-size: 15px;
}

.room-showcase,
.reservation-panel {
  grid-column: 1 / -1;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.24);
  padding: 18px;
}

.room-showcase[hidden],
.reservation-panel[hidden] {
  display: none;
}

.showcase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.showcase-head span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.close-showcase {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  background: var(--ink);
  color: #fff;
  line-height: 1;
}

.room-showcase h2,
.reservation-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: 0;
}

.room-showcase p,
.reservation-panel p {
  margin: 8px 0 16px;
  color: rgba(23, 33, 54, 0.72);
  line-height: 1.45;
}

.reservation-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.reservation-detail {
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}

.reservation-detail dt {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.reservation-detail dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.booking-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.booking-link[hidden] {
  display: none;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.media-card {
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.media-card img,
.media-card video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.media-card span {
  display: block;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes pulse {
  0% { transform: scale(0.98); opacity: 0.95; }
  70% { transform: scale(1.04); opacity: 0.28; }
  100% { transform: scale(0.98); opacity: 0.95; }
}

@keyframes talk {
  0%, 100% { transform: translate(-50%, -50%) scaleY(0.78); }
  50% { transform: translate(-50%, -50%) scaleY(1.18); }
}

@keyframes idlePortrait {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  45% { transform: translate3d(0, -0.8%, 0) scale(1.008); }
  70% { transform: translate3d(0.25%, -0.25%, 0) scale(1.004); }
}

@keyframes listenPortrait {
  0%, 100% { transform: translate3d(0, -0.35%, 0) scale(1.006) rotate(-0.08deg); }
  50% { transform: translate3d(0.45%, -1.05%, 0) scale(1.012) rotate(0.08deg); }
}

@keyframes speakPortrait {
  0%, 100% { transform: translate3d(0, -0.25%, 0) scale(1.008) rotate(0deg); }
  25% { transform: translate3d(-0.18%, -0.75%, 0) scale(1.012) rotate(-0.06deg); }
  50% { transform: translate3d(0.2%, -0.2%, 0) scale(1.007) rotate(0.08deg); }
  75% { transform: translate3d(0.08%, -0.85%, 0) scale(1.013) rotate(-0.03deg); }
}

@keyframes thinkPortrait {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.004); filter: saturate(1); }
  50% { transform: translate3d(0.2%, -0.45%, 0) scale(1.008); filter: saturate(1.06); }
}

@keyframes blink {
  0%, 92%, 100% { transform: scaleY(0); }
  94%, 96% { transform: scaleY(1); }
}

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

  .receptionist {
    grid-row: auto;
    width: min(460px, 100%);
  }

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

  .reservation-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .topbar {
    height: auto;
    min-height: 78px;
    align-items: stretch;
    flex-direction: column;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .topnav {
    width: 100%;
    flex-wrap: wrap;
    gap: 4px 14px;
    overflow-x: visible;
  }

  .topnav a {
    padding: 8px 0;
    font-size: 15px;
  }

  .stage {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 18px;
    padding: 24px;
  }

  .stage-copy,
  .control-panel,
  .voice-log,
  .reservation-panel,
  .room-showcase {
    width: min(100%, calc(100vw - 48px));
  }

  h1 {
    font-size: clamp(34px, 10vw, 42px);
  }

  .intro {
    max-width: min(100%, 330px);
    font-size: 17px;
  }

  .receptionist {
    width: min(100%, calc(100vw - 48px));
    max-width: 460px;
  }

  button {
    min-height: 48px;
    padding: 0 18px;
  }

  .room-showcase {
    padding: 14px;
  }

  .reservation-panel {
    padding: 14px;
  }

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

  .reservation-details {
    grid-template-columns: 1fr;
  }
}
