/* ============================================
   TerraElix — Plant-Based Wellness Landing
   Full-viewport hero with word-reveal animations
   ============================================ */

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

:root {
  --font-dm: 'DM Sans', system-ui, sans-serif;
  --font-inter: 'Inter', system-ui, sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font-inter);
  -webkit-font-smoothing: antialiased;
  background: #000;
  color: #fff;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; }

/* ─── Page Container ─── */
.terraelix-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── Background Image ─── */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('https://images.higgs.ai/?default=1&output=webp&url=https%3A%2F%2Fd8j0ntlcm91z4.cloudfront.net%2Fuser_38xzZboKViGWJOttwIXH07lWA1P%2Fhf_20260624_110248_b62f758d-f68c-4045-a7b4-91771d6d0a0f.png&w=1280&q=85');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ─── Navbar ─── */
.tx-nav {
  position: relative;
  z-index: 20;
  padding: 16px 20px;
}
@media (min-width: 640px)  { .tx-nav { padding: 16px 32px; } }
@media (min-width: 1024px) { .tx-nav { padding: 20px 40px; } }

.tx-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tx-brand {
  font-family: var(--font-dm);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: -0.05em;
  color: #fff;
}

.tx-nav-links {
  display: none;
  gap: 40px;
}
@media (min-width: 1024px) { .tx-nav-links { display: flex; } }

.tx-nav-links a {
  font-family: var(--font-dm);
  font-weight: 500;
  font-size: 18px;
  color: rgba(255,255,255,0.9);
  transition: opacity 0.2s;
}
.tx-nav-links a:hover { opacity: 0.7; }

.tx-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tx-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0.9;
  transition: opacity 0.2s;
}
.tx-icon-btn:hover { opacity: 0.6; }

.tx-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
@media (min-width: 1024px) {
  .tx-avatar { width: 40px; height: 40px; }
}

.tx-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.tx-menu-toggle .icon-close { display: none; }
.tx-menu-toggle.open .icon-menu  { display: none; }
.tx-menu-toggle.open .icon-close { display: block; }

@media (min-width: 768px) { .tx-menu-toggle { display: none; } }

/* ─── Mobile Menu ─── */
.tx-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0,0,0,0.92);
  display: none;
  align-items: center;
  justify-content: center;
}
.tx-mobile-menu.open { display: flex; }

.tx-mobile-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}
.tx-mobile-links a {
  font-family: var(--font-dm);
  font-size: 2rem;
  color: #fff;
}

/* ─── Hero ─── */
.tx-hero {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 20px;
}
@media (min-width: 640px)  { .tx-hero { padding: 0 32px; } }
@media (min-width: 1024px) { .tx-hero { padding: 0 40px; } }

/* ─── Headline ─── */
.tx-headline {
  font-family: var(--font-dm);
  font-weight: 400;
  letter-spacing: -0.05em;
  font-size: 48px;
  line-height: 50px;
  color: #fff;
}
@media (min-width: 640px)  { .tx-headline { font-size: 80px;  line-height: 72px; } }
@media (min-width: 768px)  { .tx-headline { font-size: 110px; line-height: 95px; } }
@media (min-width: 1024px) { .tx-headline { font-size: 130px; line-height: 110px; } }
@media (min-width: 1280px) { .tx-headline { font-size: 155px; line-height: 125px; } }

.tx-word-line {
  display: block;
  overflow: hidden;
}

.tx-word-line .word {
  display: inline-block;
  opacity: 0;
}
.tx-word-line .word.dim { color: rgba(255,255,255,0.45); }

/* Inline capsule image after "Capsule" */
.tx-inline-img {
  display: none;
  vertical-align: middle;
  margin-left: 8px;
  height: clamp(60px, 10vw, 160px);
  width: auto;
  opacity: 0;
}
@media (min-width: 640px) {
  .tx-inline-img { display: inline-block; margin-left: 16px; }
}

/* ─── CTA Section ─── */
.tx-cta-row {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  opacity: 0;
}
@media (min-width: 640px) {
  .tx-cta-row { flex-direction: row; gap: 32px; margin-top: 48px; }
}
@media (min-width: 1024px) {
  .tx-cta-row { gap: 50px; margin-top: 75px; }
}

.tx-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #000;
  color: #fff;
  border-radius: 6px;
  font-family: var(--font-inter);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: -0.03em;
  width: 100%;
  height: 56px;
  transition: background 0.2s, transform 0.2s;
}
.tx-cta-btn:hover { background: #222; transform: translateY(-1px); }
@media (min-width: 640px)  { .tx-cta-btn { width: 240px;     height: 64px; font-size: 1.125rem; } }
@media (min-width: 768px)  { .tx-cta-btn { width: 280px; } }
@media (min-width: 1024px) { .tx-cta-btn { width: 310px;     height: 72px;  font-size: 1.25rem; } }

.tx-cta-text {
  color: #fff;
  max-width: 310px;
  font-family: var(--font-inter);
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.45;
  letter-spacing: -0.03em;
}
@media (min-width: 640px)  { .tx-cta-text { font-size: 1rem; } }
@media (min-width: 1024px) { .tx-cta-text { font-size: 1.125rem; } }

/* ─── Desktop Floating Product ─── */
.tx-product-float {
  position: absolute;
  z-index: 0;
  display: none;
  width: clamp(600px, 80vw, 1412px);
  height: auto;
  bottom: -10%;
  right: clamp(-400px, -20vw, -100px);
  opacity: 0;
}
@media (min-width: 1024px) { .tx-product-float { display: block; } }

/* ─── Mobile/Tablet Product ─── */
.tx-product-mobile {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  margin-bottom: -180px;
  opacity: 0;
}
.tx-product-mobile img {
  width: 180%;
  max-width: 1296px;
  object-fit: contain;
  filter: drop-shadow(0 25px 50px rgba(0,0,0,0.4));
  pointer-events: none;
}
@media (min-width: 640px) {
  .tx-product-mobile    { margin-bottom: -220px; }
  .tx-product-mobile img { width: 151%; }
}
@media (min-width: 1024px) { .tx-product-mobile { display: none; } }

/* ─── Bottom 3-Panel Grid ─── */
.tx-panels {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .tx-panels { grid-template-columns: 2fr 1fr 2fr; }
}

.tx-panel {
  padding: 32px 24px;
  min-height: 200px;
  position: relative;
  overflow: hidden;
}
@media (min-width: 640px)  { .tx-panel { padding: 40px 32px; min-height: 240px; } }
@media (min-width: 1024px) { .tx-panel { padding: 48px 40px; min-height: 280px; } }

/* Panel 1 — Assessment */
.tx-panel-1 { background: #ECEDEC; color: #111; }
.tx-panel-1 .tx-panel-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tx-panel-1 .tx-panel-text {
  font-family: var(--font-dm);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: -0.05em;
  max-width: 350px;
}
@media (min-width: 640px)  { .tx-panel-1 .tx-panel-text { font-size: 28px; } }
@media (min-width: 1024px) { .tx-panel-1 .tx-panel-text { font-size: 35px; } }

.tx-panel-1 .tx-panel-link {
  font-family: var(--font-inter);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: -0.03em;
  color: #111;
  text-decoration: underline;
  text-underline-offset: 4px;
}
@media (min-width: 1024px) { .tx-panel-1 .tx-panel-link { font-size: 1.125rem; } }

.tx-panel-deco {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 100%;
  width: auto;
  mix-blend-mode: multiply;
  opacity: 0.5;
}

/* Panel 2 — Carousel */
.tx-panel-2 { background: #FEFDF9; color: #111; }

.tx-carousel {
  position: relative;
  min-height: 80px;
  margin-bottom: 20px;
}

.tx-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}
.tx-card.active {
  opacity: 1;
  transform: translateY(0);
  position: relative;
  pointer-events: auto;
}

.tx-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 640px) { .tx-card-icon { width: 48px; height: 48px; } }

.tx-card p {
  font-family: var(--font-inter);
  font-weight: 400;
  font-size: 0.875rem;
  color: rgba(0,0,0,0.8);
  line-height: 1.2;
  letter-spacing: -0.03em;
  max-width: 280px;
}
@media (min-width: 640px)  { .tx-card p { font-size: 1rem; } }
@media (min-width: 1024px) { .tx-card p { font-size: 1.125rem; } }

.tx-dots {
  display: flex;
  gap: 4px;
}
.tx-dots .dot {
  flex: 1;
  height: 2px;
  border-radius: 99px;
  background: rgba(0,0,0,0.2);
  transition: background 0.3s;
}
.tx-dots .dot.active { background: #000; }

/* Panel 3 — Social Proof */
.tx-panel-3 {
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 20px;
}

.tx-panel-product {
  width: 120px;
  height: 82px;
  object-fit: contain;
  flex-shrink: 0;
}
@media (min-width: 640px)  { .tx-panel-product { width: 160px; height: 110px; } }
@media (min-width: 1024px) { .tx-panel-product { width: 208px; height: 142px; } }

.tx-panel-proof {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tx-proof-num {
  font-family: var(--font-inter);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: -0.05em;
  color: #fff;
}
@media (min-width: 640px)  { .tx-proof-num { font-size: 1.875rem; } }
@media (min-width: 1024px) { .tx-proof-num { font-size: 35px; } }

.tx-proof-text {
  font-family: var(--font-inter);
  font-weight: 400;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.2;
  letter-spacing: -0.03em;
}
@media (min-width: 640px)  { .tx-proof-text { font-size: 1rem; } }
@media (min-width: 1024px) { .tx-proof-text { font-size: 1.125rem; } }

/* ============================================
   Animations
   ============================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes wordReveal {
  from { opacity: 0; transform: translateY(100%); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

.tx-easing { animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); animation-fill-mode: both; }

.animate-fade-in    { opacity: 0; animation: fadeIn    0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-fade-up    { opacity: 0; animation: fadeUp    0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-slide-left { opacity: 0; animation: slideInLeft  0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-slide-right{ opacity: 0; animation: slideInRight 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-scale-in   { opacity: 0; animation: scaleIn      1s   cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* Word reveal: animates inner spans */
.animate-word-reveal .word {
  animation: wordReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.animate-scale-in.tx-inline-img {
  animation: scaleIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Delay classes */
.delay-200  { animation-delay: 0.2s; }
.delay-300  { animation-delay: 0.3s; }
.delay-400  { animation-delay: 0.4s; }
.delay-500  { animation-delay: 0.5s; }
.delay-600  { animation-delay: 0.6s; }
.delay-700  { animation-delay: 0.7s; }
.delay-800  { animation-delay: 0.8s; }
.delay-900  { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1.0s; }
.delay-1100 { animation-delay: 1.1s; }
