/* ===== Tokens ===== */
:root {
  --bg: #ffffff;
  --text: #2b2350;
  --teal: #15b89c;
  --teal-soft: rgba(21, 184, 156, 0.12);
  --icon-color: #2b2350;
  --transition-bg: background-color 0.35s ease, color 0.35s ease;
}

body.dark {
  --bg: #15131f;
  --text: #f1eef9;
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, 0.16);
  --icon-color: #f1eef9;
}

/* ===== Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Quicksand', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  transition: var(--transition-bg);
  overflow-x: hidden;
}

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

/* used on pages meant to be exactly one screen, no scrolling */
body.lock-scroll {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ===== Top bar ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  z-index: 50;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-color);
  font-size: 1.4rem;
  transition: background-color 0.25s ease, transform 0.2s ease;
}

.icon-btn:hover {
  background-color: var(--teal-soft);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* initial pop-in for top bar icons */
.icon-pop {
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* dark mode icon swap micro-interaction */
.theme-icon {
  display: inline-flex;
  transition: transform 0.15s ease;
}

.theme-icon.shrink {
  transform: scale(0);
}

/* navigation icon press feedback */
.press-icon {
  display: inline-flex;
  transition: transform 0.15s ease;
}

.press-icon.shrink {
  transform: scale(0);
}

/* avatar photo reveal */
.avatar-photo {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(280px, 65vw);
  height: min(280px, 65vw);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.avatar-photo.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--teal);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  transition: border-color 0.35s ease;
  display: block;
}

/* rotating dashed ring around the frame */
.avatar-photo::before {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  border: 2px dashed #1a1a1a;
  animation: spin 30s linear infinite;
}

body.dark .avatar-photo::before {
  border-color: #f5f5f5;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 768px) {
  .avatar-photo {
    width: min(420px, 35vw);
    height: min(420px, 35vw);
  }

  .avatar-img {
    border-width: 6px;
  }

  .avatar-photo::before {
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
  }
}

/* ===== Hero ===== */
.hero {
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 90px 20px 40px;
}

.hero-inner {
  max-width: 800px;
  text-align: center;
}

.hero-text {
  font-size: clamp(1.6rem, 6.5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.25;
  opacity: 0;
}

.hero-text .accent {
  color: var(--teal);
}

.hero-btn {
  display: inline-block;
  margin-top: 40px;
  padding: 14px 36px;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--teal);
  border: 2px solid var(--teal);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transition: background-color 0.25s ease, color 0.25s ease, var(--transition-bg);
}

.hero-btn:hover {
  background-color: var(--teal);
  color: var(--bg);
}

/* ===== Entrance animations ===== */
/* Mobile: slide up from below */
body.anim-mobile .hero-text {
  animation: slideUpIn 0.6s ease-out 0.15s both;
}

body.anim-mobile .hero-btn {
  animation: slideUpIn 0.6s ease-out 0.75s both;
}

@keyframes slideUpIn {
  from {
    opacity: 0;
    transform: translateY(48px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Desktop: slide in from the left */
body.anim-desktop .hero-text {
  animation: slideLeftIn 0.6s ease-out 0.15s both;
}

body.anim-desktop .hero-btn {
  animation: slideLeftIn 0.6s ease-out 0.75s both;
}

@keyframes slideLeftIn {
  from {
    opacity: 0;
    transform: translateX(-72px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  body.anim-mobile .hero-text,
  body.anim-mobile .hero-btn,
  body.anim-desktop .hero-text,
  body.anim-desktop .hero-btn,
  .icon-pop {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== Placeholder page (knowmore) ===== */
.placeholder {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 60px;
  text-align: center;
}

.placeholder p {
  font-size: 1.2rem;
  opacity: 0.7;
}

/* ===== Floating chat button (all pages) ===== */
.fab-chat {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.fab-main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background-color: var(--teal);
  color: var(--bg);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: background-color 0.35s ease, color 0.35s ease, transform 0.2s ease;
}

.fab-main:hover {
  transform: scale(1.06);
}

.fab-main i {
  transition: transform 0.2s ease;
}


.fab-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.fab-item {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--bg);
  color: var(--teal);
  border: 2px solid var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(12px) scale(0.6);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

.fab-item:hover {
  background-color: var(--teal);
  color: var(--bg);
}

.fab-chat.open .fab-item {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* stagger the 3 items as they appear */
.fab-chat.open .fab-item:nth-child(1) { transition-delay: 0.05s; }
.fab-chat.open .fab-item:nth-child(2) { transition-delay: 0.1s; }
.fab-chat.open .fab-item:nth-child(3) { transition-delay: 0.15s; }
