:root {
  --navy: #080d24;
  --royal: #111a46;
  --ink: #10162f;
  --muted: #687188;
  --gold: #d7b56d;
  --gold-bright: #f7dc91;
  --cyan: #5ed9ff;
  --violet: #8d7cff;
  --coral: #ff8f75;
  --ivory: #fbf8ef;
  --paper: #f6f4ee;
  --white: #ffffff;
  --line: rgba(215, 181, 109, 0.28);
  --shadow: 0 28px 80px rgba(8, 13, 36, 0.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 16px clamp(18px, 4vw, 58px);
  color: var(--white);
  background: rgba(8, 13, 36, 0.82);
  border-bottom: 1px solid rgba(215, 181, 109, 0.24);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--navy);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(215, 181, 109, 0.38);
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.8vw, 24px);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.93rem;
  font-weight: 700;
}

nav a { padding: 8px 0; }
nav a:hover { color: var(--gold-bright); }

nav .nav-cta {
  border: 1px solid rgba(247, 220, 145, 0.72);
  border-radius: 999px;
  padding: 9px 15px;
  color: var(--navy);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 10px 26px rgba(215, 181, 109, 0.2);
}

nav .nav-cta:hover { color: var(--navy); }

.hero {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 150px clamp(20px, 5vw, 76px) 68px;
  color: var(--white);
  background:
    radial-gradient(circle at 78% 20%, rgba(94, 217, 255, 0.24), transparent 28%),
    radial-gradient(circle at 18% 27%, rgba(215, 181, 109, 0.26), transparent 30%),
    radial-gradient(circle at 52% 82%, rgba(141, 124, 255, 0.22), transparent 30%),
    linear-gradient(145deg, #05091b 0%, #111a46 52%, #291446 100%);
}

.hero::before {
  content: "";
  position: absolute;
  width: min(76vw, 1040px);
  aspect-ratio: 1;
  border: 1px solid rgba(94, 217, 255, 0.13);
  border-radius: 50%;
  box-shadow:
    0 0 0 90px rgba(94, 217, 255, 0.025),
    0 0 0 180px rgba(215, 181, 109, 0.025);
  pointer-events: none;
}

#signalCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.38;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 160px;
  background: linear-gradient(transparent, rgba(8, 13, 36, 0.84));
}

.hero-content,
.royal-card,
.hero-trust { position: relative; z-index: 1; }

.hero-content {
  width: min(100%, 1120px);
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 9px 14px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.hero-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 5px rgba(94, 217, 255, 0.12), 0 0 22px var(--cyan);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold-bright);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 1050px;
  margin: 0 auto 26px;
  font-size: clamp(3.2rem, 7vw, 7.1rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h1 em {
  display: block;
  color: transparent;
  background: linear-gradient(95deg, var(--gold-bright) 12%, var(--cyan) 54%, #c3b9ff 88%);
  background-clip: text;
  -webkit-background-clip: text;
  font-style: normal;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 4vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.18rem;
  line-height: 1.25;
}

.hero-copy {
  max-width: 790px;
  margin-right: auto;
  margin-left: auto;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1.08rem, 2vw, 1.3rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.hero-actions.compact { margin-top: 20px; }

.hero-actions-main {
  flex-direction: column;
  align-items: center;
  margin-top: 38px;
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 13px 19px;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible { transform: translateY(-2px); }

.button.primary {
  color: var(--navy);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 18px 38px rgba(215, 181, 109, 0.24);
}

.hero-cta {
  width: min(100%, 690px);
  min-height: 76px;
  justify-content: space-between;
  gap: 18px;
  border-radius: 18px;
  padding: 14px 16px 14px 28px;
  font-size: clamp(1rem, 2vw, 1.28rem);
  box-shadow:
    0 26px 70px rgba(215, 181, 109, 0.28),
    0 0 0 8px rgba(247, 220, 145, 0.07);
}

.hero-cta b {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 13px;
  color: var(--white);
  background: var(--navy);
  font-size: 1.45rem;
}

.hero-cta:hover,
.hero-cta:focus-visible {
  box-shadow:
    0 32px 90px rgba(215, 181, 109, 0.38),
    0 0 0 9px rgba(247, 220, 145, 0.1);
}

.hero-secondary-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.92rem;
  font-weight: 700;
}

.hero-secondary-link:hover { color: var(--white); }

.hero-signals {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.hero-signals span {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 13px;
  color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.82rem;
}

.hero-signals b { color: var(--white); }

.hero-trust {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.83rem;
}

.hero-trust p { margin: 0; }
.hero-trust strong { color: rgba(255, 255, 255, 0.88); }

.button.secondary {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.royal-card,
.card,
.contact-card,
.team-grid article,
.review-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.royal-card {
  padding: 28px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.royal-card strong {
  display: block;
  margin: 10px 0 12px;
  color: var(--gold-bright);
  font-size: 2rem;
  line-height: 1;
}

.rating {
  display: inline-flex;
  color: var(--navy);
  background: var(--gold-bright);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 900;
}

.address-mini {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(215, 181, 109, 0.26);
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.95rem;
}

.strengths-feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(36px, 7vw, 100px);
  overflow: hidden;
  padding: clamp(76px, 10vw, 132px) clamp(20px, 5vw, 76px);
  color: var(--white);
  background:
    radial-gradient(circle at 92% 4%, rgba(94, 217, 255, 0.16), transparent 26%),
    linear-gradient(135deg, #0a102b, #111a46 58%, #241743);
}

.strengths-feature::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -160px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(247, 220, 145, 0.15);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(247, 220, 145, 0.025);
}

.strengths-heading,
.strengths-grid,
.strengths-note { position: relative; z-index: 1; }

.strengths-heading h2 {
  font-size: clamp(2.3rem, 4.4vw, 5rem);
}

.strengths-heading > p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.68);
  font-size: 1.04rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--gold-bright);
  font-weight: 900;
}

.text-link:hover span { transform: translateX(4px); }
.text-link span { transition: transform 160ms ease; }

.strengths-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-self: center;
}

.strengths-grid article {
  min-height: 270px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

.strengths-grid article:nth-child(2) { transform: translateY(24px); }

.strengths-grid article > span {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-bottom: 60px;
  border-radius: 12px;
  color: var(--navy);
  background: linear-gradient(135deg, var(--cyan), #d9f7ff);
  font-size: 0.78rem;
  font-weight: 900;
}

.strengths-grid article:nth-child(2) > span {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
}

.strengths-grid article:nth-child(3) > span {
  background: linear-gradient(135deg, #c3b9ff, var(--violet));
}

.strengths-grid p {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.92rem;
}

.strengths-note {
  grid-column: 1 / -1;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.44);
  font-size: 0.78rem;
  text-align: right;
}

.section {
  padding: clamp(72px, 10vw, 128px) clamp(20px, 5vw, 76px);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.82fr);
  gap: clamp(28px, 5vw, 78px);
  align-items: start;
  background: var(--ivory);
}

.intro .eyebrow,
.feature-grid .eyebrow,
.training .eyebrow,
.team .eyebrow,
.reviews .eyebrow,
.contact .eyebrow { color: #8a6a2d; }

.intro > p {
  margin-top: 48px;
  color: var(--muted);
  font-size: 1.12rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--navy);
  color: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats div {
  padding: clamp(26px, 5vw, 44px);
  border-right: 1px solid rgba(215, 181, 109, 0.18);
}

.stats strong {
  display: block;
  color: var(--gold-bright);
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.stats span {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.section-heading {
  max-width: 920px;
  margin-bottom: 36px;
}

.section-heading > p:not(.eyebrow),
.training-copy p,
.contact-card p { color: var(--muted); }

.cards {
  display: grid;
  gap: 18px;
}

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

.card {
  min-height: 288px;
  padding: 30px;
  background: var(--white);
}

.card.highlight {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.9)),
    radial-gradient(circle at 20% 15%, rgba(215,181,109,0.22), transparent 32%);
}

.card p { color: var(--muted); }

.card-icon {
  display: inline-grid;
  min-width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 44px;
  border-radius: 8px;
  color: var(--navy);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  font-weight: 900;
}

.dark {
  color: var(--white);
  background:
    radial-gradient(circle at top right, rgba(94, 217, 255, 0.16), transparent 30%),
    linear-gradient(135deg, #090e26, #151d4d);
}

.dark .section-heading p:not(.eyebrow) { color: rgba(255,255,255,0.72); }

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

.service-list article {
  min-height: 250px;
  padding: 24px;
  border: 1px solid rgba(215, 181, 109, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.service-list span {
  display: inline-grid;
  min-width: 48px;
  height: 38px;
  place-items: center;
  margin-bottom: 32px;
  border-radius: 6px;
  color: var(--navy);
  background: var(--gold-bright);
  font-size: 0.78rem;
  font-weight: 900;
}

.service-list p { color: rgba(255,255,255,0.72); }

.apps {
  background:
    radial-gradient(circle at 12% 8%, rgba(94, 217, 255, 0.14), transparent 28%),
    linear-gradient(135deg, #ffffff, #f3efe3);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.app-card {
  position: relative;
  min-height: 410px;
  overflow: hidden;
  padding: 30px 30px 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--navy);
  color: var(--white);
  box-shadow: var(--shadow);
}

.app-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  opacity: 0.72;
  background:
    radial-gradient(circle at 20% 18%, rgba(247, 220, 145, 0.26), transparent 26%),
    radial-gradient(circle at 84% 8%, rgba(94, 217, 255, 0.2), transparent 30%);
}

.kids-app::before {
  background:
    radial-gradient(circle at 18% 16%, rgba(247, 220, 145, 0.28), transparent 24%),
    radial-gradient(circle at 86% 16%, rgba(125, 92, 255, 0.28), transparent 32%),
    radial-gradient(circle at 60% 88%, rgba(94, 217, 255, 0.22), transparent 30%);
}

.chess-app::before {
  background:
    radial-gradient(circle at 18% 16%, rgba(215, 181, 109, 0.28), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.14), transparent 30%),
    linear-gradient(135deg, rgba(44, 30, 87, 0.8), rgba(8, 13, 36, 0.1));
}

.music-app::before {
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 194, 104, 0.3), transparent 25%),
    radial-gradient(circle at 84% 18%, rgba(226, 90, 148, 0.25), transparent 32%),
    linear-gradient(135deg, rgba(81, 29, 87, 0.82), rgba(8, 13, 36, 0.08));
}

.runner-app::before {
  background:
    radial-gradient(circle at 20% 18%, rgba(89, 235, 255, 0.3), transparent 26%),
    radial-gradient(circle at 84% 12%, rgba(255, 94, 84, 0.28), transparent 30%),
    linear-gradient(135deg, rgba(26, 42, 111, 0.8), rgba(8, 13, 36, 0.08));
}

.app-card > * {
  position: relative;
  z-index: 1;
}

.app-topline {
  display: flex;
  min-height: 100px;
  flex-direction: column;
  justify-content: space-between;
  margin-bottom: 34px;
}

.app-topline span {
  color: var(--gold-bright);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-topline b {
  font-size: clamp(1.6rem, 2.4vw, 2.35rem);
  line-height: 1.05;
}

.app-card h3 {
  font-size: 1.34rem;
}

.app-card p {
  color: rgba(255, 255, 255, 0.75);
}

.app-link {
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 30px;
  z-index: 1;
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: var(--navy);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  font-weight: 900;
}

.training {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(300px, 0.9fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  background: var(--ivory);
}

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

.portfolio-grid span {
  min-height: 92px;
  display: flex;
  align-items: end;
  padding: 18px;
  border-radius: 8px;
  color: var(--white);
  background: linear-gradient(135deg, var(--royal), #2e1e57);
  font-weight: 800;
  box-shadow: 0 16px 36px rgba(8, 13, 36, 0.16);
}

.team { background: #ffffff; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.team-grid article {
  padding: 28px;
  background: var(--ivory);
}

.avatar {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  margin-bottom: 30px;
  border-radius: 50%;
  color: var(--navy);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  font-weight: 900;
  font-size: 1.35rem;
}

.team-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 800;
}

.reviews { background: var(--paper); }

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.review-grid article {
  padding: 24px;
  background: var(--white);
}

.review-grid p { color: #394257; }

.review-grid strong {
  display: block;
  margin-top: 22px;
  color: var(--navy);
}

.review-grid span {
  color: #8a6a2d;
  font-size: 0.92rem;
  font-weight: 800;
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(300px, 0.72fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  background:
    radial-gradient(circle at 90% 12%, rgba(215, 181, 109, 0.18), transparent 24%),
    linear-gradient(135deg, #ffffff, #f8f4e8);
}

.contact-card {
  padding: 30px;
  background: var(--white);
}

.contact-card strong { color: var(--navy); }
.contact-card a { font-weight: 800; }

.contact .button.secondary {
  color: var(--navy);
  background: var(--white);
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 30px clamp(20px, 5vw, 76px);
  color: rgba(255, 255, 255, 0.72);
  background: var(--navy);
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

footer div {
  display: flex;
  gap: 18px;
}

footer a {
  color: var(--gold-bright);
  font-weight: 800;
}

@media (max-width: 1120px) {
  .service-list,
  .review-grid,
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strengths-feature { grid-template-columns: 1fr; }

  .strengths-heading { max-width: 790px; }
}

@media (max-height: 820px) and (min-width: 901px) {
  .site-header { padding-top: 11px; padding-bottom: 11px; }

  .hero { padding-top: 112px; }

  .hero-badge { margin-bottom: 16px; }

  .hero .eyebrow { margin-bottom: 8px; }

  .hero h1 {
    max-width: 920px;
    margin-bottom: 16px;
    font-size: clamp(3rem, 6vw, 5.4rem);
  }

  .hero-copy {
    max-width: 730px;
    font-size: 1.04rem;
  }

  .hero-actions-main { margin-top: 24px; }

  .hero-cta { min-height: 66px; }

  .hero-signals,
  .hero-trust { margin-top: 20px; }
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px 18px;
  }

  nav {
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  nav .nav-cta { white-space: nowrap; }

  .intro,
  .training,
  .contact {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 100svh;
    padding-top: 172px;
  }

  .intro > p { margin-top: 0; }

  .stats,
  .cards.three,
  .team-grid,
  .app-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: center;
    flex-direction: row;
    padding: 10px 14px;
  }

  .brand > span:last-child { display: none; }

  nav {
    width: auto;
    justify-content: flex-end;
    overflow: visible;
    padding: 0;
  }

  nav a:not(.nav-cta) { display: none; }

  nav .nav-cta {
    padding: 8px 13px;
    font-size: 0.83rem;
  }

  h1 {
    font-size: clamp(2.65rem, 14vw, 4.2rem);
  }

  .hero {
    padding-top: 104px;
    padding-right: 18px;
    padding-bottom: 50px;
    padding-left: 18px;
  }

  .hero-badge {
    max-width: 94%;
    justify-content: center;
    text-align: left;
  }

  .hero-copy { font-size: 1rem; }

  .hero-cta {
    min-height: 72px;
    padding-left: 19px;
    text-align: left;
  }

  .hero-signals {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-trust {
    align-items: flex-start;
    text-align: left;
  }

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

  .strengths-grid article,
  .strengths-grid article:nth-child(2) {
    min-height: auto;
    transform: none;
  }

  .strengths-grid article > span { margin-bottom: 30px; }

  .strengths-note { text-align: left; }

  .service-list,
  .review-grid,
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .button { width: 100%; }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  #signalCanvas { display: none; }
}

/* ChaiBot */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.chaibot-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 82px;
  border: 1px solid rgba(247, 220, 145, 0.76);
  border-radius: 25px;
  padding: 6px 18px 6px 6px;
  color: var(--navy);
  background: linear-gradient(135deg, #fff0b7, var(--gold));
  box-shadow: 0 18px 48px rgba(8, 13, 36, 0.3), 0 0 0 7px rgba(247, 220, 145, 0.08);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.chaibot-launcher:hover,
.chaibot-launcher:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 24px 60px rgba(8, 13, 36, 0.36), 0 0 0 8px rgba(247, 220, 145, 0.12);
}

.chaibot-launcher[aria-expanded="true"] {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.chaibot-launcher-icon {
  display: grid;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  place-items: center;
  transform-origin: 50% 82%;
  pointer-events: none;
}

.chaibot-launcher-icon img,
.chaibot-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.chaibot-launcher-icon img {
  filter: drop-shadow(0 8px 8px rgba(51, 27, 6, 0.22));
}

.chaibot-launcher.is-hopping .chaibot-launcher-icon {
  animation: chaibot-mascot-hop 1.15s cubic-bezier(0.2, 0.75, 0.2, 1);
}

.chaibot-launcher.is-waving .chaibot-launcher-icon {
  animation: chaibot-mascot-wave 1.2s ease-in-out;
}

.chaibot-launcher.is-popping .chaibot-launcher-icon {
  animation: chaibot-mascot-pop 1.05s ease-in-out;
}

.chaibot-launcher > span:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.chaibot-launcher strong { font-size: 1rem; }
.chaibot-launcher small { margin-top: 4px; color: rgba(8, 13, 36, 0.62); font-size: 0.7rem; font-weight: 800; }

.chaibot-panel {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  width: min(410px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 38px));
  grid-template-rows: auto minmax(180px, 1fr) auto auto auto;
  overflow: hidden;
  border: 1px solid rgba(215, 181, 109, 0.34);
  border-radius: 24px;
  color: var(--ink);
  background: rgba(251, 248, 239, 0.98);
  box-shadow: 0 32px 100px rgba(8, 13, 36, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
}

.chaibot-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.chaibot-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px;
  color: var(--white);
  background:
    radial-gradient(circle at 85% 5%, rgba(94, 217, 255, 0.18), transparent 35%),
    linear-gradient(135deg, var(--navy), #211646);
}

.chaibot-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

@keyframes chaibot-mascot-hop {
  0%, 100% { transform: translateY(0) rotate(0); }
  28% { transform: translateY(-14px) rotate(-7deg); }
  48% { transform: translateY(0) rotate(5deg); }
  67% { transform: translateY(-6px) rotate(-3deg); }
  84% { transform: translateY(0) rotate(2deg); }
}

@keyframes chaibot-mascot-wave {
  0%, 100% { transform: rotate(0) scale(1); }
  20% { transform: rotate(-10deg) scale(1.04); }
  40% { transform: rotate(9deg) scale(1.04); }
  60% { transform: rotate(-7deg) scale(1.03); }
  80% { transform: rotate(5deg) scale(1.02); }
}

@keyframes chaibot-mascot-pop {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.14) translateY(-4px); }
  50% { transform: scale(0.95); }
  72% { transform: scale(1.08) translateY(-2px); }
}

.chaibot-header h2 { margin: 0; font-size: 1.05rem; letter-spacing: 0; }
.chaibot-header p { display: flex; align-items: center; gap: 7px; margin: 3px 0 0; color: rgba(255, 255, 255, 0.64); font-size: 0.72rem; }
.chaibot-header p span { width: 7px; height: 7px; border-radius: 50%; background: #74e0b5; box-shadow: 0 0 0 4px rgba(116, 224, 181, 0.11); }

.chaibot-close {
  width: 36px;
  height: 36px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.07);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.chaibot-messages {
  overflow-y: auto;
  padding: 18px 16px 10px;
  scroll-behavior: smooth;
}

.chaibot-message {
  max-width: 88%;
  margin-bottom: 10px;
  border-radius: 16px;
  padding: 11px 13px;
  font-size: 0.86rem;
  line-height: 1.48;
  animation: chaibot-message-in 180ms ease both;
}

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

.chaibot-message p { margin: 0; }
.chaibot-message p + p { margin-top: 7px; }

.chaibot-message.bot {
  border: 1px solid rgba(17, 26, 70, 0.08);
  border-bottom-left-radius: 5px;
  color: #303852;
  background: var(--white);
  box-shadow: 0 7px 24px rgba(8, 13, 36, 0.07);
}

.chaibot-message.user {
  margin-left: auto;
  border-bottom-right-radius: 5px;
  color: var(--white);
  background: linear-gradient(135deg, var(--royal), #30205e);
}

.chaibot-apps {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.chaibot-app-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(17, 26, 70, 0.1);
  border-radius: 14px;
  padding: 10px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 7px 20px rgba(8, 13, 36, 0.06);
}

.chaibot-app-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  color: var(--navy);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  font-size: 1.1rem;
}

.chaibot-app-card:nth-child(2) .chaibot-app-icon { background: linear-gradient(135deg, #9ff5ec, var(--cyan)); }
.chaibot-app-card:nth-child(3) .chaibot-app-icon { color: var(--white); background: linear-gradient(135deg, #9a87e9, #4d327d); }
.chaibot-app-card:nth-child(4) .chaibot-app-icon { color: var(--white); background: linear-gradient(135deg, #f0a964, #b83d83); }
.chaibot-app-card:nth-child(5) .chaibot-app-icon { color: var(--white); background: linear-gradient(135deg, #35cfe8, #ef5750); }

.chaibot-app-copy { min-width: 0; }
.chaibot-app-copy strong { display: block; color: var(--navy); font-size: 0.82rem; }
.chaibot-app-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 0.68rem; line-height: 1.35; }

.chaibot-app-card > a {
  border-radius: 9px;
  padding: 7px 9px;
  color: var(--navy);
  background: var(--gold-bright);
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.chaibot-app-invite {
  margin: 2px 0 10px;
  color: #655020;
  font-size: 0.76rem;
  font-weight: 800;
}

.chaibot-prompts {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 8px 16px 10px;
  scrollbar-width: none;
}

.chaibot-prompts::-webkit-scrollbar { display: none; }

.chaibot-prompts button {
  flex: 0 0 auto;
  border: 1px solid rgba(17, 26, 70, 0.13);
  border-radius: 999px;
  padding: 8px 11px;
  color: #38415c;
  background: rgba(255, 255, 255, 0.76);
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
}

.chaibot-prompts button:hover,
.chaibot-prompts button:focus-visible { border-color: var(--gold); background: #fff7d7; }

.chaibot-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  margin: 0 14px;
  border: 1px solid rgba(17, 26, 70, 0.14);
  border-radius: 15px;
  padding: 5px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(8, 13, 36, 0.07);
}

.chaibot-form:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(215, 181, 109, 0.12); }

.chaibot-form input {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 8px 9px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
}

.chaibot-form input::placeholder { color: #9298a8; }

.chaibot-form button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  color: var(--navy);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
}

.chaibot-privacy {
  margin: 9px 14px 12px;
  color: #8a8f9c;
  font-size: 0.64rem;
  text-align: center;
}

.chaibot-whatsapp-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 10px;
  border-radius: 11px;
  padding: 10px 13px;
  color: #fff;
  background: #178b4c;
  box-shadow: 0 8px 18px rgba(23, 139, 76, 0.22);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

.chaibot-whatsapp-link:hover,
.chaibot-whatsapp-link:focus-visible {
  background: #0f753e;
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  body.chaibot-open { overflow: hidden; }

  .chaibot-launcher {
    right: 14px;
    bottom: 14px;
    min-height: 72px;
    border-radius: 22px;
    padding-right: 14px;
  }

  .chaibot-launcher-icon { width: 62px; height: 62px; flex-basis: 62px; }

  .chaibot-panel {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 20px;
  }

  .chaibot-app-card { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .chaibot-app-card > a { padding: 7px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .chaibot-message { animation: none; }
  .chaibot-panel,
  .chaibot-launcher { transition: none; }
  .chaibot-launcher-icon { animation: none !important; }
}
