/* =============================================
   Haven & Code — Home Page v3
   Warm, polished, human visual direction
   ============================================= */

/* ── Hero ─────────────────────────────────── */

.hero {
  position: relative;
  min-height: 68vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #0F1712;
}

.hero__media {
  position: absolute;
  inset: -10%; /* extra space for parallax scroll */
  z-index: 0;
  background: linear-gradient(135deg, #0F1712 0%, #1A2820 50%, #0F1712 100%);
  will-change: transform;
}

.hero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero__video--active {
  opacity: .72;
}

.hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    105deg,
    rgba(15,23,18,.82) 0%,
    rgba(15,23,18,.55) 50%,
    rgba(15,23,18,.28) 100%
  );
}

/* Warm grain texture overlay for depth */
.hero__media::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: .35;
  pointer-events: none;
}

.hero .container {
  position: relative; z-index: 1;
  padding-top: 6rem; padding-bottom: 4rem;
}

.hero__content { max-width: 860px; }

.hero__headline {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 4.8vw, 4.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.025em;
  color: white;
  margin-bottom: 1.6rem;
  max-width: 820px;
}

.hero__sub {
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.7;
  color: rgba(255,255,255,.75);
  margin-bottom: .75rem;
  max-width: 560px;
}

.hero__sub2 {
  font-size: .96rem;
  line-height: 1.72;
  color: rgba(255,255,255,.48);
  margin-bottom: 2.5rem;
  max-width: 520px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-bottom: 2.75rem;
}

.hero__trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  font-size: .79rem;
  color: rgba(255,255,255,.38);
  font-weight: 500;
}
.hero__trust-dot { opacity: .3; }

/* Scroll hint */
.hero__scroll-hint {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .45rem;
  z-index: 1;
}
.hero__scroll-line {
  width: 1px; height: 36px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.3));
  animation: scroll-line 2.4s ease-in-out infinite;
}
@keyframes scroll-line {
  0%, 100% { opacity: 0; transform: scaleY(0); transform-origin: top; }
  40%, 60% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}
.hero__scroll-hint span {
  font-family: var(--font-ui);
  font-size: .6rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
}

/* ── Ticker / Trust bar ──────────────────── */
.hero-ticker {
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,.06);
  overflow: hidden;
  padding: .75rem 0;
  position: relative;
}
.hero-ticker::before,
.hero-ticker::after {
  content: '';
  position: absolute; top: 0; bottom: 0; width: 60px;
  z-index: 2; pointer-events: none;
}
.hero-ticker::before {
  left: 0;
  background: linear-gradient(to right, var(--ink), transparent);
}
.hero-ticker::after {
  right: 0;
  background: linear-gradient(to left, var(--ink), transparent);
}
.hero-ticker__track {
  display: flex;
  gap: 0;
  animation: ticker-scroll 30s linear infinite;
  white-space: nowrap;
}
.hero-ticker__item {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: 0 2rem;
  font-family: var(--font-ui);
  font-size: .79rem;
  font-weight: 600;
  color: rgba(255,255,255,.92);
  letter-spacing: .03em;
  flex-shrink: 0;
}
.hero-ticker__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--primary); opacity: .7; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Core Idea ────────────────────────────── */

.core-idea { background: var(--white); }

.core-idea__layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 5rem;
  align-items: center;
  margin-bottom: 4.5rem;
}

.core-idea__text .label { margin-bottom: .65rem; }
.core-idea__text .display-lg { margin-bottom: 1.2rem; }

/* Customer Journey */
.core-idea__journey {
  background: var(--cream);
  border-radius: 22px;
  padding: 2rem 1.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.journey-step {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .95rem 1.1rem;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--border);
  transition: box-shadow .22s, transform .22s;
}
.journey-step:hover { box-shadow: var(--shadow-md); transform: translateX(3px); }

.journey-step__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}

.journey-step--discover .journey-step__icon { background: var(--sky-pale); color: var(--sky); }
.journey-step--trust   .journey-step__icon  { background: var(--primary-pale); color: var(--primary); }
.journey-step--act     .journey-step__icon  { background: var(--sage-pale); color: var(--sage); }
.journey-step--grow    .journey-step__icon  { background: var(--amber-pale); color: var(--amber); }

.journey-step__content { display: flex; flex-direction: column; gap: .08rem; }
.journey-step__content strong { font-size: .9rem; font-weight: 700; color: var(--ink); }
.journey-step__content span { font-size: .77rem; color: var(--mid); }

.journey-arrow {
  text-align: center; padding: .28rem 0;
  font-size: .9rem; color: var(--border-dark); opacity: .7;
}

.core-idea__statement {
  border-left: 3px solid var(--primary);
  padding: 1.75rem 2.25rem;
  background: var(--primary-pale);
  border-radius: 0 16px 16px 0;
}
.core-idea__statement blockquote {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--ink-soft);
  line-height: 1.7;
  font-weight: 600;
}

/* ── Why Haven & Code ─────────────────────── */

.why-hc__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.75rem;
}

.why-hc__card {
  text-align: center;
  padding: 2.25rem 1.5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .28s, transform .28s, border-color .28s;
  position: relative;
  overflow: hidden;
}
.why-hc__card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.why-hc__card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); border-color: var(--primary); }
.why-hc__card:hover::before { transform: scaleX(1); }

.why-hc__card-icon { font-size: 2rem; margin-bottom: .9rem; display: block; }
.why-hc__card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; color: var(--ink); }
.why-hc__card p { font-size: .875rem; color: var(--mid); line-height: 1.65; }

.why-hc__philosophy { display: flex; justify-content: center; }
.why-hc__philosophy-inner {
  display: inline-flex; align-items: center; gap: .85rem;
  background: var(--ink);
  color: rgba(255,255,255,.7);
  padding: 1rem 2rem;
  border-radius: 100px;
  font-size: .9rem;
}
.why-hc__philosophy-inner strong { color: white; }
.why-hc__philosophy-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: .82rem; flex-shrink: 0;
}

/* ── Who We Help ─────────────────────────── */

.who-we-help__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
  margin-bottom: 2.5rem;
  perspective: 1200px; /* 3D context for tile flip animations */
}

/* ── Biz-tile: 3D flip-in reveal on scroll ──────────────────── */
.biz-tile {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 3/4;
  box-shadow: var(--shadow-sm);
  cursor: default;
  /* Flip-in scroll reveal state — starts rotated + hidden */
  opacity: 0;
  transform: rotateY(90deg) scale(0.92);
  transform-style: preserve-3d;
  transition:
    opacity .55s ease,
    transform .55s cubic-bezier(.16,1,.3,1),
    box-shadow .32s;
  will-change: transform, opacity;
}

/* Once JS adds .tile-visible the tile flips into view */
.biz-tile.tile-visible {
  opacity: 1;
  transform: rotateY(0deg) scale(1);
}

/* Hover lift (only once visible) */
.biz-tile.tile-visible:hover {
  transform: rotateY(0deg) translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.biz-tile__img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform .45s ease;
}
.biz-tile:hover .biz-tile__img { transform: scale(1.06); }

.biz-tile::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(22,28,25,.88) 0%, rgba(22,28,25,.2) 50%, transparent 100%);
}

.biz-tile__label {
  position: absolute; bottom: 0; left: 0; right: 0;
  z-index: 1;
  padding: 1.1rem .9rem .8rem;
  font-family: var(--font-ui);
  font-size: .82rem; font-weight: 700;
  color: white; text-align: center;
  letter-spacing: .01em;
}

.who-we-help__note {
  font-size: 1rem;
  font-style: italic;
  color: var(--mid);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Home CTA ─────────────────────────────── */

.home-cta {
  position: relative; overflow: hidden;
  padding: 7rem 0;
  background: var(--ink);
}
.home-cta__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 65% 70% at 15% 50%, rgba(61,107,82,.3) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 85% 50%, rgba(92,138,117,.2) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 100%, rgba(184,137,58,.12) 0%, transparent 55%);
  pointer-events: none;
}
.home-cta .container { position: relative; z-index: 1; }
.home-cta__inner { text-align: center; max-width: 600px; margin: 0 auto; }
.home-cta__inner .label { margin-bottom: .85rem; color: var(--amber); }
.home-cta__inner .display-lg { margin-bottom: .85rem; color: white; }
.home-cta__inner .lead { margin-bottom: 2.5rem; color: rgba(255,255,255,.58); }
.home-cta__actions {
  display: flex; flex-wrap: wrap;
  justify-content: center; gap: .9rem;
}

/* ── Responsive ───────────────────────────── */

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

@media (max-width: 768px) {
  .core-idea__layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .why-hc__grid { grid-template-columns: 1fr 1fr; }
  .who-we-help__grid { grid-template-columns: repeat(2, 1fr); }
  .biz-tile { aspect-ratio: 1; }
  .hero__actions { flex-direction: column; align-items: flex-start; }
  .hero__actions .btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .why-hc__grid { grid-template-columns: 1fr; }
  .home-cta__actions { flex-direction: column; align-items: center; }
  .home-cta__actions .btn { width: 100%; justify-content: center; }
  .core-idea__statement { padding: 1.25rem 1.5rem; }
}
