*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--app-bg);
  color: var(--ink);
  font-family: 'M PLUS Rounded 1c', sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, p, ul { margin: 0; padding: 0; }
button { font-family: inherit; }

:root {
  --app-bg: #eef2f6;
  --panel: #ffffff;
  --ink: #1c2733;
  --muted: #8993a1;
  --accent: #4fa3e0;
  --accent-deep: #3c85bd;
  --yellow: #ffcf47;
  --line: #dfe5ec;
  --shadow: 0 6px 20px rgba(28,39,51,0.08);
}

.section-title { font-family: 'M PLUS Rounded 1c', sans-serif; font-weight: 800; font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.2; }
.tag { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-deep); margin-bottom: 0.6rem; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal { transition: none; } }

/* ---------- Top app bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.4rem;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__contact { display: flex; align-items: center; gap: 0.6rem; }
.topbar__avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: #dfe7ee; flex-shrink: 0; }
.topbar__avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.topbar__who { display: flex; flex-direction: column; line-height: 1.2; }
.topbar__who strong { font-size: 0.98rem; font-weight: 700; }
.topbar__who em { font-style: normal; font-size: 0.74rem; color: var(--muted); display: flex; align-items: center; gap: 0.3rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #38c76b; display: inline-block; }

.topbar__links { display: flex; gap: 1.4rem; }
.topbar__links a { font-size: 0.9rem; font-weight: 700; color: var(--muted); }
.topbar__links a:hover { color: var(--ink); }
.topbar__burger { display: none; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; padding: 6px; }
.topbar__burger span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ---------- App buttons: each style genuinely different ---------- */
.btn-app { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-weight: 700; }

.btn-app--nav { font-size: 0.82rem; padding: 0.5rem 0.9rem; background: var(--accent); color: #fff; border-radius: 999px; }
.btn-app--nav:hover { background: var(--accent-deep); }

.btn-app--send {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(79,163,224,0.45);
  transition: transform 0.15s;
}
.btn-app--send:hover { transform: scale(1.06); }

.btn-app--pill {
  margin-top: 2.2rem;
  font-size: 0.95rem; padding: 0.75rem 1.6rem;
  border: 2px solid var(--ink); color: var(--ink);
  border-radius: 999px;
  background: transparent;
}
.btn-app--pill:hover { background: var(--ink); color: #fff; }

.btn-app--full {
  width: 100%; max-width: 420px;
  font-size: 1.1rem; padding: 1.05rem;
  background: var(--ink); color: #fff;
  border-radius: 16px;
}
.btn-app--full:hover { background: #0d151f; }

/* ---------- Chat thread ---------- */
.thread { padding: 6.5rem 1.2rem 1rem; scroll-margin-top: 84px; }
.thread__inner { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 0.55rem; }
.thread__date { text-align: center; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.6rem; }

.bubble { display: flex; align-items: flex-end; gap: 0.5rem; max-width: 85%; }
.bubble__ava { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: center 30%; flex-shrink: 0; background: #dfe7ee; }
.bubble__msg {
  background: var(--panel);
  border-radius: 4px 16px 16px 16px;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  box-shadow: var(--shadow);
}
.bubble--img { max-width: 65%; }
.bubble__msg--img { padding: 6px; border-radius: 4px 16px 16px 16px; overflow: hidden; }
.bubble__msg--img img { border-radius: 4px 12px 12px 12px; width: 100%; }

.typing { display: flex; gap: 4px; padding: 0.8rem 1rem 0.8rem 2.3rem; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; } }

.composer {
  max-width: 460px; margin: 1.6rem auto 0;
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--panel);
  border-radius: 999px;
  padding: 0.5rem 0.6rem 0.5rem 1.1rem;
  box-shadow: var(--shadow);
}
.composer__field { flex: 1; color: var(--muted); font-size: 0.95rem; }

/* ---------- Sticker tray ---------- */
.stickers { padding: 5rem 1.4rem; text-align: center; }
.stickers__sub { color: var(--muted); margin-top: 0.4rem; margin-bottom: 2.4rem; }
.tray {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1rem;
  max-width: 720px;
  margin: 0 auto;
}
.sticker {
  background: var(--panel);
  border: none;
  border-radius: 20px;
  padding: 1rem 0.6rem 0.8rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.sticker:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(28,39,51,0.14); }
.sticker img { height: 76px; width: auto; object-fit: contain; }
.sticker span { font-size: 0.78rem; color: var(--muted); font-weight: 700; text-align: center; }

/* ---------- Profile ---------- */
.profile { padding: 5rem 1.4rem; }
.profile__card {
  max-width: 780px; margin: 0 auto;
  background: var(--panel);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
}
.profile__photo { width: 42%; object-fit: cover; }
.profile__info { padding: 2.2rem 2rem; flex: 1; }
.profile__status { font-size: 1.05rem; margin: 0.4rem 0 1.4rem; color: var(--accent-deep); font-weight: 700; }
.profile__facts { display: flex; flex-direction: column; gap: 0.7rem; }
.profile__facts li { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.9rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--line); }
.profile__facts li span { color: var(--muted); }
.profile__facts li strong { text-align: right; }

/* ---------- Closer ---------- */
.closer { padding: 3rem 1.4rem 6rem; }
.thread__inner--closer { margin-bottom: 1.8rem; }
.closer__cta { display: flex; justify-content: center; }

/* ---------- Footer ---------- */
.footer { padding: 2rem 1.4rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; font-size: 0.85rem; color: var(--muted); }

@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .tray { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .profile__card { flex-direction: column; }
  .profile__photo { width: 100%; height: 220px; }
}

@media (max-width: 760px) {
  .topbar__links { display: none; }
  .topbar__burger { display: flex; }
  .topbar__links.is-open { display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--panel); padding: 1.1rem 1.4rem; gap: 0.9rem; border-bottom: 1px solid var(--line); }
}
