/* ==========================================================================
   Fourfold - Homepage Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-slate) 100%);
  color: var(--text-on-dark);
}

/* Gradient accent glow */
.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 60%;
  height: 120%;
  background: radial-gradient(ellipse at center, rgba(20, 184, 166, 0.15) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -5%;
  width: 50%;
  height: 80%;
  background: radial-gradient(ellipse at center, rgba(45, 212, 191, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.hero__content {
  max-width: 900px;
  position: relative;
  z-index: 1;
}

.hero__headline {
  font-size: var(--text-hero);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  margin-bottom: 4rem;
  color: var(--white);
}

/* Accent color on key word */
.hero__headline .accent {
  color: var(--accent-bright);
}

/* Highlighter effect */
.hero__headline .highlight {
  position: relative;
  display: inline-block;
}

.hero__headline .highlight::before {
  content: '';
  position: absolute;
  left: -0.15em;
  right: -0.15em;
  top: -0.05em;
  bottom: -0.05em;
  background: linear-gradient(135deg, #2DD4BF 0%, #5EEAD4 100%);
  opacity: 0.85;
  z-index: -1;
  transform: skewX(-3deg);
  border-radius: 4px;
}

.hero__tagline {
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  color: rgba(255, 255, 255, 0.85);
  line-height: var(--leading-relaxed);
  max-width: 800px;
  margin: 0 auto 3rem;
}

/* Hero CTA Button */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--accent);
  color: var(--white);
  border-radius: 50px;
  font-weight: 500;
  font-size: 1.0625rem;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.hero-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.hero-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(20, 184, 166, 0.35);
  gap: 1rem;
  padding-right: 1.75rem;
}

.hero-cta:hover::before {
  opacity: 1;
}

.hero-cta__text {
  position: relative;
  z-index: 1;
}

.hero-cta__icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-cta:hover .hero-cta__icon {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Trusted By Section
   -------------------------------------------------------------------------- */
.trusted-by {
  padding: 2.5rem 0;
  background: var(--bg-teal);
  overflow: hidden;
  position: relative;
}

.trusted-by__label {
  position: absolute;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  z-index: 3;
}

@media (max-width: 768px) {
  .trusted-by__label {
    position: static;
    transform: none;
    display: block;
    text-align: center;
    margin-bottom: 1.5rem;
  }
}

.marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.marquee::before,
.marquee::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  pointer-events: none;
}

.marquee::before {
  left: 0;
  width: 250px;
  background: linear-gradient(to right, var(--bg-teal) 50%, transparent 100%);
}

.marquee::after {
  right: 0;
  width: 100px;
  background: linear-gradient(to left, var(--bg-teal) 0%, transparent 100%);
}

.marquee__track {
  display: flex;
  align-items: center;
  gap: 5rem;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

.client-logo {
  height: 36px;
  width: auto;
  opacity: 0.7;
  filter: brightness(0) invert(1);
  transition: opacity var(--duration-fast) ease;
  flex-shrink: 0;
}

.client-logo:hover {
  opacity: 1;
}

.client-logo--tall {
  height: 64px;
}

/* --------------------------------------------------------------------------
   What We Do Section
   -------------------------------------------------------------------------- */
.what-we-do {
  background: var(--bg-light);
}

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

.what-capture__title {
  font-size: var(--text-h3);
  font-weight: 600;
  margin-bottom: 1rem;
}

.what-capture__description {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  text-align: center;
  max-width: 800px;
  margin: 0 auto 4rem;
}

.subsection-title {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2.5rem;
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Service Card */
.service-card {
  position: relative;
  padding: 2rem;
  background: var(--white);
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  transition: all var(--duration-normal) var(--ease-out);
  overflow: hidden;
}

.service-card::before {
  content: attr(data-index);
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-size: 3rem;
  font-weight: 600;
  color: rgba(20, 184, 166, 0.15);
  line-height: 1;
}

.service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(13, 148, 136, 0.1));
  opacity: 0;
  transition: opacity var(--duration-normal) ease;
  pointer-events: none;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(13, 148, 136, 0.2);
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--white) 0%, rgba(20, 184, 166, 0.05) 100%);
}

.service-card:hover::after {
  opacity: 1;
}

.service-card:hover .card-icon {
  color: var(--accent-dark);
  transform: scale(1.1);
}

.card-icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
  margin-bottom: 1.25rem;
  transition: all var(--duration-fast) ease;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: var(--leading-tight);
}

.card-description {
  font-size: var(--text-small);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* --------------------------------------------------------------------------
   Why fourfold Section
   -------------------------------------------------------------------------- */
.toggle-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 3rem;
}

.services-toggle {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--border-on-dark);
  border-radius: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.toggle-tab {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .toggle-tab {
    padding: 0.75rem 2.5rem;
  }
}

.toggle-tab.active {
  background: var(--accent);
  color: var(--white);
}

.toggle-tab:not(.active):hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

/* Why Panels */
.why-content {
  position: relative;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.why-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.why-panel.active {
  position: relative;
  opacity: 1;
  visibility: visible;
}

/* Panel Header */
.why-panel__header {
  text-align: center;
  margin-bottom: 3rem;
}

.why-panel__title {
  font-size: var(--text-h3);
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--white);
}

.why-panel__description {
  color: rgba(255, 255, 255, 0.85);
  line-height: var(--leading-relaxed);
  font-size: 1.0625rem;
  max-width: 700px;
  margin: 0 auto;
}

/* Numbered Cards Grid */
.why-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

.why-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.4s var(--ease-out);
  opacity: 0;
  transform: translateY(20px);
}

@media (min-width: 768px) {
  .why-card {
    padding: 2.5rem;
  }
}

.why-panel.active .why-card {
  opacity: 1;
  transform: translateY(0);
}

.why-panel.active .why-card:nth-child(1) { transition-delay: 0.1s; }
.why-panel.active .why-card:nth-child(2) { transition-delay: 0.15s; }
.why-panel.active .why-card:nth-child(3) { transition-delay: 0.2s; }
.why-panel.active .why-card:nth-child(4) { transition-delay: 0.25s; }

.why-card:hover {
  transform: translateY(-6px);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.15) 0%, rgba(45, 212, 191, 0.08) 100%);
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(20, 184, 166, 0.25), 0 0 60px rgba(45, 212, 191, 0.1);
}

.why-card__number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-bright);
  margin-bottom: 1.25rem;
  line-height: 1;
}

.why-card__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}

.why-card__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 1.25rem 0;
}

.why-card__description {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   In Practice (Use Cases) Section - Interactive Tabs
   -------------------------------------------------------------------------- */
.in-practice {
  background: var(--white);
}

.use-cases-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 768px) {
  .use-cases-container {
    grid-template-columns: 280px 1fr;
    gap: 3rem;
  }
}

@media (min-width: 1024px) {
  .use-cases-container {
    grid-template-columns: 320px 1fr;
    gap: 4rem;
  }
}

/* Tab Navigation */
.use-case-tabs {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .use-case-tabs {
    flex-direction: column;
    gap: 0;
    margin-bottom: 0;
    overflow-x: visible;
    padding-bottom: 0;
  }
}

.use-case-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .use-case-tab {
    padding: 1.25rem 1.5rem;
    border-radius: 12px 0 0 12px;
    white-space: normal;
  }
}

.use-case-tab::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transition: height var(--duration-fast) ease;
}

@media (min-width: 768px) {
  .use-case-tab::before {
    display: block;
  }
}

.use-case-tab:hover {
  background: var(--bg-light);
}

.use-case-tab.active {
  background: var(--bg-light);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.use-case-tab.active::before {
  height: 60%;
  background: var(--accent);
}

.tab-number {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-light);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--duration-fast) ease;
}

@media (min-width: 768px) {
  .tab-number {
    display: flex;
  }
}

.use-case-tab.active .tab-number {
  background: var(--accent);
  color: var(--white);
}

.tab-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--duration-fast) ease;
}

.use-case-tab.active .tab-label,
.use-case-tab:hover .tab-label {
  color: var(--text-primary);
}

/* Tab Content Panels */
.use-case-panels {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  min-height: 300px;
}

.use-case-panel {
  display: none;
  opacity: 0;
  transform: translateY(16px);
  width: 100%;
}

.use-case-panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.panel-content {
  background: var(--bg-light);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-subtle);
}

@media (min-width: 768px) {
  .panel-content {
    padding: 3rem;
  }
}

.panel-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white);
  margin-bottom: 1rem;
  padding: 0.375rem 0.75rem;
  background: var(--bg-teal);
  border-radius: 4px;
}

.panel-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

.panel-description,
.panel-overview {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: 1.5rem;
}

.panel-what-we-did {
  margin-bottom: 2rem;
}

.panel-subheading {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-dark);
  margin-bottom: 1rem;
}

.panel-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.panel-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.panel-list li:last-child {
  margin-bottom: 0;
}

.panel-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 6px;
  height: 6px;
  background: var(--bg-teal);
  border-radius: 50%;
}

.panel-outcome {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--bg-light) 0%, rgba(13, 148, 136, 0.1) 100%);
  border-radius: 12px;
  border-left: 3px solid var(--bg-teal);
}

.outcome-icon {
  width: 24px;
  height: 24px;
  color: var(--bg-teal);
  flex-shrink: 0;
  margin-top: 2px;
}

.outcome-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: var(--leading-normal);
}

/* Panel CTA Button */
.panel-cta {
  display: inline-flex;
  align-items: center;
  align-self: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--accent);
  color: var(--white);
  border-radius: 50px;
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  margin-top: 2rem;
}

.panel-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(20, 184, 166, 0.35);
  gap: 1rem;
  padding-right: 1.75rem;
}

.panel-cta__text {
  position: relative;
}

.panel-cta__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.panel-cta:hover .panel-cta__icon {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   CTA Section
   -------------------------------------------------------------------------- */
.cta-section {
  text-align: center;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-slate) 100%);
}

.cta-content {
  max-width: 600px;
  margin: 0 auto;
}

.cta-headline {
  font-size: var(--text-h2);
  font-weight: 600;
  line-height: var(--leading-tight);
  margin-bottom: 1rem;
}

.cta-subtext {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2.5rem;
  font-size: 1.125rem;
}

/* --------------------------------------------------------------------------
   Responsive - Desktop
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .hero {
    padding-top: 8rem;
  }
}

/* --------------------------------------------------------------------------
   Mobile (max-width: 767px)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .hero {
    min-height: auto;
    padding: 6rem 0 4rem;
  }

  .hero__headline {
    margin-bottom: 2rem;
    font-size: clamp(2rem, 8vw, 2.5rem);
  }

  .hero__tagline {
    margin-bottom: 2rem;
    font-size: 1rem;
  }

  .hero__tagline br {
    display: none;
  }

  .hero-cta {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
  }

  .hero-cta:active {
    transform: scale(0.98);
  }

  .section {
    padding: 3rem 0;
  }

  .section__title {
    margin-bottom: 2rem;
  }

  .service-card {
    padding: 1.5rem;
  }

  .service-card::before {
    font-size: 2rem;
  }

  .toggle-wrapper {
    margin-bottom: 2rem;
  }

  .services-toggle {
    width: 100%;
  }

  .toggle-tab {
    flex: 1;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    text-align: center;
  }

  .why-panel__header {
    margin-bottom: 2rem;
  }

  .why-card {
    padding: 1.5rem;
  }

  .why-card__number {
    font-size: 2rem;
    margin-bottom: 1rem;
  }

  .why-card__title {
    font-size: 1.125rem;
  }

  .why-card__description {
    font-size: 0.9375rem;
  }

  .use-case-tabs {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .use-case-tabs::-webkit-scrollbar {
    display: none;
  }

  .use-case-tab {
    padding: 0.75rem 1rem;
  }

  .tab-label {
    font-size: 0.8125rem;
  }

  .panel-content {
    padding: 1.5rem;
  }

  .panel-title {
    font-size: 1.25rem;
  }

  .panel-overview {
    font-size: 0.9375rem;
  }

  .panel-list li {
    font-size: 0.9375rem;
  }

  .panel-outcome {
    padding: 1rem;
    flex-direction: column;
    gap: 0.75rem;
  }

  .panel-cta {
    align-self: stretch;
    justify-content: center;
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
  }

  .cta-headline {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .cta-subtext {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .marquee::before {
    width: 100px;
  }

  .marquee::after {
    width: 60px;
  }

  .client-logo {
    height: 28px;
  }

  .marquee__track {
    gap: 3rem;
  }

  .what-capture__description {
    margin-bottom: 2.5rem;
    font-size: 0.9375rem;
  }

  .subsection-title {
    margin-bottom: 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   Small Mobile (max-width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .hero__headline {
    font-size: 1.75rem;
  }

  .hero__headline .highlight::before {
    left: -0.1em;
    right: -0.1em;
  }

  .toggle-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  .why-card__number {
    font-size: 1.75rem;
  }

  .panel-title {
    font-size: 1.125rem;
  }
}

/* --------------------------------------------------------------------------
   Touch Device Optimizations
   -------------------------------------------------------------------------- */
@media (hover: none) and (pointer: coarse) {
  .service-card:hover {
    transform: none;
    box-shadow: none;
  }

  .why-card:hover {
    transform: none;
    box-shadow: none;
  }

  .service-card:active {
    transform: scale(0.98);
    border-color: var(--accent);
  }

  .why-card:active {
    transform: scale(0.98);
    border-color: var(--accent);
  }

  .hero-cta:active,
  .panel-cta:active {
    transform: scale(0.97);
  }

  .toggle-tab,
  .use-case-tab {
    min-height: 44px;
  }
}
