/* ============================================
   Habits.AI Marketing Website — Styles
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  background: #000;
  color: #fff;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

/* --- Utilities --- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.text-secondary {
  color: rgba(255, 255, 255, 0.6);
}

.text-tertiary {
  color: rgba(255, 255, 255, 0.5);
}

.text-muted {
  color: rgba(255, 255, 255, 0.4);
}

.text-center {
  text-align: center;
}

.font-light {
  font-weight: 300;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  letter-spacing: -0.04em;
  font-weight: 600;
  line-height: 1.05;
}

h1 {
  font-size: clamp(3.5rem, 8vw, 8rem);
}

h2 {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
}

h3 {
  font-size: 1.5rem;
  letter-spacing: -0.025em;
}

p {
  font-weight: 300;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn--primary {
  background: #fff;
  color: #000;
  padding: 0 2rem;
  height: 3rem;
  border-radius: 9999px;
  font-size: 1rem;
}

.btn--primary:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.05);
}

.btn--ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(10, 14, 21, 0.95) 0%, rgba(7, 10, 16, 0.9) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 4.5rem;
  position: relative;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.nav__logo img {
  height: 2rem;
  width: auto;
}

@media (max-width: 768px) {
  .nav__logo img {
    height: 2rem;
  }
}

.nav__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.25rem;
  flex: 1;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav__link {
  position: relative;
  padding: 0.25rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.62);
  transition: color 0.2s ease;
  text-align: center;
}

.nav__link:hover,
.nav__link--active {
  color: #fff;
}

.nav__link--active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1.15rem;
  height: 1px;
  background: rgba(255, 255, 255, 0.75);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn--nav-link {
  border-radius: 0.625rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
}

.btn--nav-primary {
  height: 2.25rem;
  padding: 0 1rem;
  border-radius: 0.625rem;
  font-size: 0.9rem;
}

.btn--nav-primary:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.9);
}

/* Mobile nav toggle */
.nav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.625rem;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  color: rgba(255, 255, 255, 0.82);
  transition: all 0.2s ease;
}

.nav__toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav__toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Mobile menu */
.nav__mobile-menu {
  display: none;
  position: fixed;
  top: 4.5rem;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 10, 16, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 1.5rem;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 49;
}

.nav__mobile-menu.is-open {
  display: flex;
}

.nav__mobile-link {
  display: block;
  padding: 0.95rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: color 0.2s ease;
}

.nav__mobile-link:hover,
.nav__mobile-link--active {
  color: #fff;
}

.nav__mobile-cta {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.75rem;
}

.btn--mobile-ghost,
.btn--mobile-primary {
  width: 100%;
  height: 2.75rem;
  border-radius: 0.75rem;
}

.btn--mobile-ghost {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 768px) {
  .nav__right {
    display: none;
  }

  .nav__toggle {
    display: inline-flex;
  }
}

/* --- Hero Section --- */
.hero {
  position: relative;
  padding: 10rem 1.5rem 5rem;
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.03), transparent);
}

.hero__inner {
  max-width: 1024px;
  margin: 0 auto;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(4px);
}

.badge__dot {
  position: relative;
  display: inline-flex;
  width: 6px;
  height: 6px;
}

.badge__dot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.badge__dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #fff;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Hero text */
.hero__headline {
  margin-bottom: 1.5rem;
}

.hero__subheadline {
  max-width: 640px;
  margin: 0 auto 3rem;
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
}

.hero__cta {
  margin-bottom: 2rem;
}

/* --- Fade-in animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 1s ease, transform 1s ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Section divider --- */
.divider {
  width: 8rem;
  height: 1px;
  margin: 0 auto;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
}

/* --- Features Section --- */
.features {
  padding: 8rem 1.5rem;
  position: relative;
}

.features__header {
  text-align: center;
  margin-bottom: 6rem;
}

.features__header p {
  max-width: 640px;
  margin: 1rem auto 0;
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.5);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5rem 3rem;
  max-width: 1152px;
  margin: 0 auto;
}

.feature__title {
  margin-bottom: 0.75rem;
}

.feature__description {
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.7;
}

@media (max-width: 1024px) {
  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .features__grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

/* --- Stats Section --- */
.stats {
  padding: 8rem 1.5rem;
  text-align: center;
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4rem;
  margin-bottom: 4rem;
}

.stat__number {
  font-size: clamp(3.5rem, 6vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.75rem;
  background: linear-gradient(to bottom, #fff, rgba(255, 255, 255, 0.6));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat__label {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 300;
  font-size: 1.125rem;
}

@media (max-width: 640px) {
  .stats__grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

/* --- Footer --- */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3rem 1.5rem;
  margin-top: 5rem;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__copy {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 300;
}

.footer__links {
  display: flex;
  gap: 2rem;
}

.footer__link {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.2s ease;
  font-weight: 300;
}

.footer__link:hover {
  color: #fff;
}

@media (max-width: 640px) {
  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

/* --- Page Content (About, Terms, Contact) --- */
.page {
  padding: 8rem 1.5rem 4rem;
}

.page__header {
  text-align: center;
  margin-bottom: 4rem;
}

.page__header h1 {
  margin-bottom: 1rem;
}

.page__header p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.6);
  max-width: 640px;
  margin: 0 auto;
}

.page__content {
  max-width: 768px;
  margin: 0 auto;
}

.page__content h2 {
  font-size: 1.75rem;
  margin: 3rem 0 1rem;
}

.page__content h3 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
}

.page__content p {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.page__content ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.page__content li {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.5rem;
  line-height: 1.8;
  list-style: disc;
}

.page__content a {
  color: #a78bfa;
  transition: color 0.2s ease;
}

.page__content a:hover {
  color: #818cf8;
}

/* --- About page specifics --- */
.values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin: 3rem 0;
}

.value-card {
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.value-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}

.value-card p {
  font-size: 0.9375rem;
}

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

/* --- Contact page specifics --- */
.contact-card {
  max-width: 480px;
  margin: 0 auto;
  padding: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

.contact-card h3 {
  margin-bottom: 1rem;
}

.contact-card p {
  margin-bottom: 1.5rem;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  color: #a78bfa;
  transition: color 0.2s ease;
}

.contact-email:hover {
  color: #818cf8;
}

/* --- Responsive hero --- */
@media (min-width: 640px) {
  .hero {
    padding: 14rem 1.5rem 8rem;
  }
}

@media (max-width: 640px) {
  .hero__subheadline br {
    display: none;
  }
}
