:root {
  color-scheme: light;
  --ink: #18211f;
  --muted: #5d6865;
  --paper: #f3efe6;
  --screen: #ece5dd;
  --received: #ffffff;
  --sent: #d9fdd3;
  --green: #178c5f;
  --green-dark: #0e5e41;
  --blue: #2d6cdf;
  --coral: #d46951;
  --phone: #121517;
  --edge: #2b3034;
  --shadow: 0 34px 90px rgba(18, 21, 23, 0.32);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(212, 105, 81, 0.28), transparent 28rem),
    radial-gradient(circle at 82% 78%, rgba(45, 108, 223, 0.22), transparent 26rem),
    linear-gradient(135deg, #f8f1e6 0%, #eef3ef 45%, #e7eef6 100%);
  color: var(--ink);
  overflow: hidden;
}

button {
  color: inherit;
  font: inherit;
}

.stage {
  position: relative;
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: clamp(18px, 3vw, 38px);
  isolation: isolate;
}

.ambient {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.ambient__line {
  position: absolute;
  border: 1px solid rgba(24, 33, 31, 0.08);
  transform: rotate(-12deg);
}

.ambient__line--one {
  width: 62vw;
  height: 62vw;
  left: -22vw;
  top: -30vw;
  border-radius: 38%;
}

.ambient__line--two {
  width: 48vw;
  height: 48vw;
  right: -18vw;
  bottom: -24vw;
  border-radius: 34%;
}

.ambient__panel {
  position: absolute;
  width: min(220px, 25vw);
  padding: 18px 20px;
  border: 1px solid rgba(24, 33, 31, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: 0 18px 55px rgba(24, 33, 31, 0.08);
  backdrop-filter: blur(14px);
}

.ambient__panel span {
  display: block;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ambient__panel strong {
  display: block;
  margin-top: 8px;
  color: rgba(24, 33, 31, 0.74);
  font-size: 16px;
  line-height: 1.25;
}

.ambient__panel--left {
  left: 8vw;
  bottom: 16vh;
}

.ambient__panel--right a,
.ambient__panel--right a:visited,
.ambient__panel--right a:hover,
.ambient__panel--right a:active {
    text-decoration: none;
}


.ambient__panel--right {
  right: 7vw;
  top: 18vh;
    pointer-events: auto;
}

.site-controls {
  position: fixed;
  top: clamp(14px, 2.4vw, 26px);
  right: clamp(14px, 3vw, 34px);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 12;
}

.language-switch {
  display: inline-flex;
  padding: 4px;
  border: 1px solid rgba(24, 33, 31, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 12px 32px rgba(24, 33, 31, 0.1);
  backdrop-filter: blur(16px);
}

.language-switch__button,
.policy-button {
  border: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.language-switch__button {
  min-width: 44px;
  height: 32px;
  border-radius: 999px;
  background: transparent;
  color: rgba(24, 33, 31, 0.64);
  text-transform: uppercase;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.language-switch__button.is-active {
  background: var(--green);
  color: #fff;
  box-shadow: 0 8px 20px rgba(23, 140, 95, 0.2);
}

.policy-button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(24, 33, 31, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--green-dark);
  box-shadow: 0 12px 32px rgba(24, 33, 31, 0.1);
  backdrop-filter: blur(16px);
}

.policy-popover {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: start end;
  padding: 72px clamp(14px, 3vw, 34px) 20px;
  background: rgba(18, 21, 23, 0.22);
  z-index: 20;
}

.policy-popover[hidden] {
  display: none;
}

.policy-popover__panel {
  position: relative;
  width: min(420px, calc(100vw - 28px));
  padding: 20px 22px 22px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 70px rgba(18, 21, 23, 0.2);
  backdrop-filter: blur(18px);
  animation: popIn 0.18s ease both;
}

.policy-popover__panel h2 {
  margin: 0 36px 10px 0;
  font-size: 18px;
  line-height: 1.2;
}

.policy-popover__panel p {
  margin: 0;
  color: #3f4a46;
  font-size: 14px;
  line-height: 1.52;
}

.policy-popover__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(24, 33, 31, 0.08);
  color: #26302c;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.phone-shell {
  width: min(100%, 430px);
  filter: drop-shadow(var(--shadow));
}

.phone {
  position: relative;
  aspect-ratio: 390 / 844;
  width: 100%;
  min-height: 620px;
  max-height: calc(100dvh - 38px);
  margin: auto;
  border: clamp(9px, 2.3vw, 13px) solid var(--phone);
  border-radius: 52px;
  background: var(--phone);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.05),
    inset 0 0 0 7px rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.phone::before,
.phone::after {
  position: absolute;
  content: "";
  background: #0b0d0f;
  border-radius: 999px;
  z-index: 3;
}

.phone::before {
  width: 4px;
  height: 78px;
  left: -13px;
  top: 140px;
}

.phone::after {
  width: 4px;
  height: 112px;
  right: -13px;
  top: 188px;
}

.island {
  position: absolute;
  z-index: 8;
  top: 10px;
  left: 50%;
  width: 116px;
  height: 34px;
  border-radius: 999px;
  background: #060708;
  transform: translateX(-50%);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.07);
}

.screen {
  position: relative;
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-radius: 39px;
  background:
    linear-gradient(rgba(236, 229, 221, 0.91), rgba(236, 229, 221, 0.91)),
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(24, 33, 31, 0.035) 10px 11px),
    repeating-linear-gradient(-45deg, transparent 0 12px, rgba(24, 33, 31, 0.025) 12px 13px);
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 16px 28px 0;
  color: #111;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  background: #075e54;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 7px;
}

.signal {
  width: 18px;
  height: 11px;
  background: linear-gradient(to right, #fff 20%, transparent 20% 30%, #fff 30% 50%, transparent 50% 60%, #fff 60% 80%, transparent 80%);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  opacity: 0.95;
}

.wifi {
  width: 15px;
  height: 10px;
  border: 2px solid #fff;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  opacity: 0.95;
}

.battery {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 23px;
  height: 12px;
  padding: 2px;
  border: 1.7px solid #fff;
  border-radius: 4px;
}

.battery::after {
  position: absolute;
  right: -4px;
  width: 2px;
  height: 5px;
  border-radius: 2px;
  background: #fff;
  content: "";
}

.battery span {
  width: 74%;
  height: 100%;
  border-radius: 2px;
  background: #fff;
}

.chat-header {
  display: grid;
  grid-template-columns: 35px 42px 1fr auto;
  align-items: center;
  min-height: 66px;
  padding: 7px 10px 9px;
  background: #075e54;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  z-index: 2;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: currentColor;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.icon-button:active {
  transform: scale(0.94);
}

#backButton span {
  display: block;
  font-size: 34px;
  line-height: 0.8;
  transform: translateY(-1px);
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.56);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08)),
    #56736d;
  font-size: 20px;
  font-weight: 800;
}

.contact {
  min-width: 0;
  padding-left: 10px;
}

.contact h1 {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.77);
  font-size: 12px;
  line-height: 1.1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.header-actions .icon-button {
  font-size: 20px;
  font-weight: 700;
}

.chat-window {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 10px 18px;
  scroll-behavior: smooth;
}

.chat-window::-webkit-scrollbar {
  width: 0;
}

.day-pill {
  width: max-content;
  margin: 0 auto 12px;
  padding: 6px 11px;
  border-radius: 8px;
  background: rgba(244, 248, 251, 0.86);
  color: #66726d;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message-row {
  display: flex;
  margin: 7px 0;
  animation: rise 0.28s ease both;
}

.message-row.sent {
  justify-content: flex-end;
}

.bubble {
  position: relative;
  max-width: min(79%, 306px);
  padding: 8px 10px 18px;
  border-radius: 8px;
  background: var(--received);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
  color: #15201d;
  font-size: clamp(13px, 3.2vw, 14px);
  line-height: 1.36;
  overflow-wrap: anywhere;
}

.sent .bubble {
  background: var(--sent);
}

.bubble::before {
  position: absolute;
  top: 0;
  width: 9px;
  height: 13px;
  background: inherit;
  content: "";
}

.received .bubble::before {
  left: -7px;
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

.sent .bubble::before {
  right: -7px;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.bubble a {
  color: #1262b3;
  font-weight: 700;
  text-decoration: none;
}

.bubble a:hover {
  text-decoration: underline;
}

.message-time {
  position: absolute;
  right: 8px;
  bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: rgba(21, 32, 29, 0.52);
  font-size: 10px;
  white-space: nowrap;
}

.sent .message-time::after {
  color: #4ea3d8;
  content: "✓✓";
  font-size: 9px;
  letter-spacing: -2px;
}

.typing-row {
  display: flex;
  margin: 7px 0;
}

.typing-row.sent {
  justify-content: flex-end;
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 48px;
  padding: 10px 13px;
  border-radius: 9px;
  background: var(--received);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.typing-row.sent .typing {
  background: var(--sent);
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8a9590;
  animation: dot 0.95s ease-in-out infinite;
}

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

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

.composer {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 7px;
  padding: 8px 9px 14px;
}

.composer__plus,
.composer__mic {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #f7f7f7;
  color: #65706c;
  font-size: 22px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07);
}

.composer__mic {
  background: var(--green);
  color: #fff;
  font-size: 21px;
}

.composer__input {
  min-width: 0;
  height: 38px;
  padding: 10px 14px;
  border-radius: 20px;
  background: #fff;
  color: #87918d;
  font-size: 14px;
  line-height: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07);
  transition: color 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer__input.is-typing {
  color: #29322f;
}

.start-card {
  position: absolute;
  inset: auto 18px 92px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 48px rgba(20, 31, 28, 0.18);
  backdrop-filter: blur(16px);
  z-index: 5;
  animation: dockBounce 1.8s cubic-bezier(0.28, 0.84, 0.42, 1) infinite;
}

.start-card.is-hidden {
  pointer-events: none;
  animation: hideStart 0.35s ease forwards;
}

.start-card__kicker {
  margin: 0 0 5px;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.start-card h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.1;
}

.start-card p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.32;
}

.start-button {
  display: inline-grid;
  min-width: 76px;
  min-height: 42px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(23, 140, 95, 0.28);
}

.start-button:active {
  transform: translateY(1px);
}

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

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

@keyframes hideStart {
  to {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
}

@keyframes dockBounce {
  0%,
  48%,
  70%,
  88%,
  100% {
    transform: translateY(0);
  }
  18% {
    transform: translateY(-18px);
  }
  34% {
    transform: translateY(0);
  }
  58% {
    transform: translateY(-9px);
  }
  78% {
    transform: translateY(-4px);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 820px) {
  .ambient__panel {
    display: none;
  }

  .stage {
    padding-top: 72px;
  }

  .site-controls {
    top: 14px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .phone-shell {
    width: min(100%, 410px);
  }

  .phone {
    max-height: calc(100dvh - 92px);
  }
}

@media (max-width: 460px) {
  body {
    overflow: hidden;
  }

  .stage {
    padding: 52px 0 0;
  }

  .site-controls {
    top: 8px;
    right: 8px;
    left: 8px;
    transform: none;
    justify-content: flex-end;
  }

  .policy-button {
    min-height: 36px;
    padding-inline: 12px;
  }

  .language-switch__button {
    min-width: 40px;
    height: 28px;
  }

  .phone-shell {
    width: 100%;
    height: calc(100dvh - 52px);
  }

  .phone {
    width: 100%;
    height: calc(100dvh - 52px);
    min-height: 0;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .phone::before,
  .phone::after,
  .island {
    display: none;
  }

  .screen {
    border-radius: 0;
  }

  .status-bar {
    height: 42px;
    padding-top: 12px;
  }

  .chat-header {
    min-height: 62px;
  }

  .bubble {
    max-width: 84%;
  }

  .start-card {
    inset: auto 12px 84px;
  }

  .policy-popover {
    place-items: start center;
    padding-top: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
