/* ====================================================
   FAIRBUILD — IDEO-Inspired Dark Theme
   ==================================================== */

:root {
  --bg-color: #151f27;         /* IDEO Dark Navy Canvas */
  --bg-color-alt: #101820;     /* IDEO Deeper Navy/Charcoal */
  --bg-surface: #1E2B38;       /* IDEO Card Navy */
  --text-primary: #FFFFFF;
  --text-secondary: #A0B2C1;   /* Soft slate grey text */
  --accent-green: #d9ff00;     /* IDEO Neon Yellow-Green */
  --accent-secondary: #C74F13; /* IDEO Orange Roughy */
  --accent-alert: #4952B9;     /* IDEO Blue Violet */

  --card-bg: #1E2B38;
  --glass-border: rgba(255,255,255,0.08);

  --font-family: 'Inter', "Helvetica Neue", -apple-system, BlinkMacSystemFont, sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}


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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.7;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

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

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

/* Typography */
h1, h2, h3, h4 {
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(3.5rem, 8vw, 7.5rem);
  font-weight: 800;
  margin-bottom: 2rem;
  letter-spacing: -0.04em;
  line-height: 0.95;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

p {
  color: var(--text-secondary);
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
}

.badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 4px;
  background: rgba(217, 255, 0, 0.1);
  color: var(--accent-green);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  border: 1px solid rgba(217, 255, 0, 0.2);
}

.badge-sm {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  background: rgba(217, 255, 0, 0.1); /* Neon yellow alpha */
  color: var(--accent-green);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  border: 1px solid rgba(217, 255, 0, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.125rem;
  transition: var(--transition-smooth);
  cursor: pointer;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-color);
  border: none;
}

.btn-primary:hover {
  background: var(--accent-green);
  color: #101820; /* Keep high contrast vs neon yellow */
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--text-primary);
  color: var(--bg-color);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 4rem;
}

/* ====================================================
   Navigation
   ==================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  transition: var(--transition-smooth);
  padding: 1.5rem 0;
}

.navbar.scrolled {
  padding: 1rem 0;
  background: rgba(21, 31, 39, 0.85); /* IDEO Navy */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ====================================================
   'fair' 2x2 Grid Logo
   ==================================================== */
.fair-logo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 32px;
  height: 32px;
  gap: 2px;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.fair-letter {
  background-color: var(--text-primary);
  color: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.fair-logo:hover .fair-f { transform: translate(-2px, -2px); background-color: var(--accent-alert); color: #FFF; }
.fair-logo:hover .fair-a { transform: translate(2px, -2px); background-color: var(--accent-secondary); color: #FFF; }
.fair-logo:hover .fair-i { transform: translate(-2px, 2px); background-color: var(--accent-green); color: #FFF; }
.fair-logo:hover .fair-r { transform: translate(2px, 2px); background-color: #F59E0B; color: #FFF; }
.fair-logo:hover {
  transform: scale(1.1) rotate(2deg);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-weight: 500;
  transition: var(--transition-smooth);
  color: var(--text-secondary);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.mobile-menu-btn span {
  width: 30px;
  height: 2px;
  background-color: var(--text-primary);
  transition: var(--transition-smooth);
}

/* ====================================================
   Hero — IDEO-style centered messaging w/ rolling text
   ==================================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
  padding-top: 5rem;
  text-align: center;
  overflow: hidden;
  background-color: var(--bg-color);
}

.hero-bg-glow {
  display: none;
}

.hero-content {
  max-width: 900px;
  padding: 0 2rem;
  z-index: 2;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 3rem;
}

/* Rolling text animation */
.rolling-text-wrapper {
  overflow: hidden;
  height: 1.1em;
  display: inline-block;
  vertical-align: bottom;
  position: relative;
}

.rolling-text-track {
  display: flex;
  flex-direction: column;
  animation: rollUp 10s ease-in-out infinite;
}

.rolling-text-track span {
  display: block;
  height: 1.1em;
  line-height: 1.1;
  white-space: nowrap;
}

@keyframes rollUp {
  0%, 18%   { transform: translateY(0); }
  22%, 40%  { transform: translateY(-1.1em); }
  44%, 62%  { transform: translateY(-2.2em); }
  66%, 84%  { transform: translateY(-3.3em); }
  88%, 100% { transform: translateY(-4.4em); }
}

.hero-image {
  margin-top: 4rem;
  max-width: 900px;
  width: 90%;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  z-index: 2;
}

.hero-image img {
  transform: scale(1.05);
  transition: transform 10s ease-out;
}

.hero-image:hover img {
  transform: scale(1);
}

/* ====================================================
   Why Us / Pillars Section
   ==================================================== */
.why-us {
  background-color: var(--bg-color-alt);
  position: relative;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.pillar-card {
  background: transparent;
  padding: 3rem 0;
  transition: var(--transition-smooth);
  border-bottom: 1px solid var(--glass-border);
}

.pillar-card:last-child {
  border-bottom: none;
}

.pillar-card.full-span {
  grid-column: 1 / -1;
  text-align: center;
}

.icon-circle {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pillar-card.full-span .icon-circle {
  margin: 0 auto 1.5rem;
}

/* Products Section */
.products {
  background-color: var(--bg-color);
}

.product-showcase {
  display: flex;
  align-items: center;
  gap: 4rem;
  margin-bottom: 6rem;
}

.product-showcase.reverse {
  flex-direction: row-reverse;
}

.product-info {
  flex: 1;
}

.product-image {
  flex: 1;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
}

.product-image::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  border: 1px solid var(--glass-border);
  pointer-events: none;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
}

.glass-card .card-img {
  height: auto;
  min-height: 250px;
  object-fit: contain;
  width: 100%;
  margin-bottom: 2rem;
}

.glass-card .card-content {
  padding: 2rem;
}

/* ====================================================
   Footer — Dark
   ==================================================== */
.footer {
  background-color: var(--bg-color-alt);
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--glass-border);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

.footer-brand .fair-logo {
  margin-bottom: 1.5rem;
}

.social-links {
  margin-top: 1.5rem;
}

.social-icon img {
  height: 30px;
  filter: brightness(0.7);
  transition: var(--transition-smooth);
}

.social-icon:hover img {
  filter: brightness(1);
}

.social-icon:hover {
  color: var(--text-primary) !important;
}

.footer-contact p, .footer-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  transition: var(--transition-smooth);
}

.footer-links ul {
  list-style: none;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ====================================================
   Animations
   ==================================================== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}

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

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; }
.delay-4 { transition-delay: 0.8s; }
.delay-5 { transition-delay: 1.0s; }

/* ====================================================
   Dark Section Modifier
   ==================================================== */
.dark-section {
  background: var(--bg-surface);
}

/* ====================================================
   Responsive
   ==================================================== */
@media (max-width: 900px) {
  .product-showcase, .product-showcase.reverse {
    flex-direction: column;
    gap: 2rem;
  }

  .pillar-card[style*="display: flex"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2rem !important;
    padding: 2rem 0 !important;
  }
  .pillar-card[style*="display: flex"] > div {
    text-align: left !important;
    width: 100% !important;
  }

  h1 {
    font-size: clamp(2.75rem, 10vw, 4rem) !important;
    margin-bottom: 1.5rem !important;
  }
  h2 {
    font-size: clamp(2rem, 7vw, 2.75rem) !important;
  }

  .nav-links, .nav-container > div > a.btn-primary {
    display: none !important;
  }
  .mobile-menu-btn {
    display: flex !important;
  }

  .chat-area {
    margin: 0 1rem;
    height: auto !important;
    min-height: 80vh;
    box-shadow: none !important;
    border-radius: 8px !important;
  }
  .demo-layout {
    padding-top: 100px !important;
    height: auto !important;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: var(--bg-color-alt);
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    gap: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    clip-path: circle(0% at 100% 0%);
    transition: var(--transition-smooth);
  }
  
  .nav-links.active {
    clip-path: circle(150% at 100% 0%);
  }

  .mobile-menu-btn {
    display: flex;
  }
  
  .mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
  }
  .mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  h1 { font-size: 2.5rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-content { grid-template-columns: 1fr; gap: 2rem; }
  .hero-cta { flex-direction: column; }
}

@media (max-width: 480px) {
  .hero {
    padding-top: 8rem !important;
  }
  .section {
    padding: 4rem 0 !important;
  }
  .chat-messages {
    padding: 1rem !important;
  }
  .msg-content {
    width: 100% !important;
  }
}

/* ====================================================
   Input & Forms Dark Override
   ==================================================== */
input[type="text"], input[type="email"], textarea {
    color: var(--text-primary) !important;
    background-color: rgba(255,255,255,0.05) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    border: 1px solid var(--glass-border) !important;
}
