/* ============================================
   The Ceiba House — Custom Front Page Styles
   All classes prefixed ch- to avoid Total theme conflicts
   ============================================ */

:root {
  --ch-gold: #B8943E; --ch-gold-light: #D4B96A; --ch-gold-pale: #E8D5A3;
  --ch-cream: #F5F0E6; --ch-warm-white: #FAF8F3; --ch-charcoal: #1A1A1A;
  --ch-deep-brown: #2C1810; --ch-olive-bg: #2A2A1E; --ch-olive: #3A3A2A;
  --ch-terracotta: #A0522D; --ch-sage: #8B9A7B;
  --ch-text-dark: #2C2C2C; --ch-text-light: #F5F0E6; --ch-text-muted: #7A7568;
  --ch-font-display: 'Cormorant Garamond', Georgia, serif;
  --ch-font-body: 'Montserrat', 'Helvetica Neue', sans-serif;
  --ch-section-pad: clamp(80px, 10vw, 160px); --ch-content-max: 1400px;
}

/* Reset for front page */
.home .ch-site-content *,
.home .ch-portal *,
.home .ch-nav *,
.home .ch-footer * { box-sizing: border-box; }
.home .ch-site-content img,
.home .ch-portal img { max-width: none; display: block; }
.home .ch-site-content a,
.home .ch-portal a,
.home .ch-nav a,
.home .ch-footer a { color: inherit; text-decoration: none; }

/* Hide Total theme header/footer on front page */
.home #masthead,
.home #ht-masthead,
.home #colophon,
.home #ht-colophon,
.home .site-header,
.home .ht-site-header,
.home .site-footer,
.home .ht-site-footer,
.home #ht-bottom-footer { display: none !important; }
.home .ht-header,
.home #ht-masthead { border-top: none !important; }
.home #ht-colophon { border-top: none !important; }

/* ============================================ PORTAL ============================================ */
.ch-portal { position: relative; height: 380vh; }
.ch-portal__sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; background: var(--ch-olive-bg); }

.ch-portal__hero {
  position: absolute; inset: 0; z-index: 1;
  background-size: cover; background-position: center;
}
.ch-portal__hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(26,26,26,0.1) 0%, rgba(26,26,26,0.35) 50%, rgba(26,26,26,0.8) 100%);
}

.ch-portal__svg-layer {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.ch-portal__svg-layer img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.ch-portal__svg1 { z-index: 10; transform-origin: 50% 57%; will-change: transform; background: var(--ch-olive-bg); }
.ch-portal__svg2 { z-index: 11; will-change: opacity; }
.ch-portal__svg3 { z-index: 12; will-change: opacity; }

.ch-portal__hero-content {
  position: absolute; z-index: 3;
  bottom: clamp(80px, 10vh, 140px); left: clamp(48px, 6vw, 120px);
  max-width: 800px; opacity: 0; will-change: opacity;
}
.ch-hero__tag { font-family: var(--ch-font-body); font-size: 10px; font-weight: 500; letter-spacing: 5px; text-transform: uppercase; color: var(--ch-gold-light); margin-bottom: 24px; }
.ch-hero__title { font-family: var(--ch-font-display); font-size: clamp(48px, 6vw, 88px); font-weight: 300; line-height: 1.05; color: var(--ch-text-light); margin-bottom: 28px; }
.ch-hero__title em { font-style: italic; color: var(--ch-gold-light); }
.ch-hero__subtitle { font-family: var(--ch-font-body); font-size: 14px; font-weight: 300; line-height: 1.8; color: rgba(245,240,230,0.7); max-width: 480px; margin-bottom: 40px; }
.ch-hero__btn { display: inline-block; font-family: var(--ch-font-body); font-size: 10px; font-weight: 500; letter-spacing: 3px; text-transform: uppercase; color: var(--ch-text-light); border: 1px solid var(--ch-gold); padding: 16px 40px; transition: all 0.4s ease; }
.ch-hero__btn:hover { background: var(--ch-gold); color: var(--ch-charcoal); }

.ch-portal__hero-scroll {
  position: absolute; z-index: 3; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0; will-change: opacity;
}
.ch-portal__hero-scroll span { font-size: 9px; letter-spacing: 3px; text-transform: uppercase; color: rgba(245,240,230,0.4); font-family: var(--ch-font-body); }
.ch-portal__hero-scroll-line { width: 1px; height: 40px; background: var(--ch-gold); opacity: 0.4; animation: chScrollPulse 2s ease infinite; }

.ch-portal__prompt {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 10px; will-change: opacity;
}
.ch-portal__prompt span { font-family: var(--ch-font-body); font-size: 9px; letter-spacing: 3px; text-transform: uppercase; color: rgba(245,240,230,0.35); }
.ch-portal__prompt-line { width: 1px; height: 36px; background: var(--ch-gold); opacity: 0.3; animation: chScrollPulse 2s ease infinite; }

/* ============================================ NAV ============================================ */
.ch-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 24px clamp(24px, 4vw, 64px);
  display: flex; align-items: center; justify-content: space-between;
  opacity: 0; pointer-events: none;
  transition: transform 0.4s ease, background 0.4s ease;
}
.ch-nav.visible { opacity: 1; pointer-events: auto; }
.ch-nav.solid { background: rgba(26,26,26,0.95); backdrop-filter: blur(12px); }
.ch-nav.hidden { transform: translateY(-100%); }
.ch-nav__logo img { height: 36px; filter: brightness(0) invert(1); opacity: 0.9; }
.ch-nav__right { display: flex; align-items: center; gap: 44px; }
.ch-nav__links { display: flex; gap: 36px; list-style: none; margin: 0; padding: 0; }
.ch-nav__links a { font-family: var(--ch-font-body); font-size: 10px; font-weight: 400; letter-spacing: 2.5px; text-transform: uppercase; color: var(--ch-text-light); position: relative; padding-bottom: 2px; opacity: 0.75; transition: opacity 0.3s ease; }
.ch-nav__links a:hover { opacity: 1; }
.ch-nav__links a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 1px; background: var(--ch-gold); transition: width 0.3s ease; }
.ch-nav__links a:hover::after { width: 100%; }
.ch-nav__enquire { font-family: var(--ch-font-body); font-size: 10px; font-weight: 400; letter-spacing: 2.5px; text-transform: uppercase; color: var(--ch-gold-light); opacity: 0.85; transition: opacity 0.3s ease; }
.ch-nav__enquire:hover { opacity: 1; }
.ch-nav__hamburger { display: none; flex-direction: column; gap: 6px; cursor: pointer; padding: 8px; background: none; border: none; }
.ch-nav__hamburger span { width: 26px; height: 1px; background: var(--ch-text-light); display: block; transition: transform 0.3s ease, opacity 0.3s ease; }
.ch-nav__hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.ch-nav__hamburger.active span:nth-child(2) { opacity: 0; }
.ch-nav__hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile menu */
.ch-mobile-menu {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 999;
  background: rgba(26,26,26,0.97); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.ch-mobile-menu.open { opacity: 1; pointer-events: auto; }
.ch-mobile-menu ul { list-style: none; text-align: center; padding: 0; margin: 0; }
.ch-mobile-menu li { margin-bottom: 32px; }
.ch-mobile-menu a { font-family: var(--ch-font-display); font-size: 32px; font-weight: 300; color: var(--ch-text-light); letter-spacing: 2px; transition: color 0.3s ease; }
.ch-mobile-menu a:hover { color: var(--ch-gold-light); }

/* ============================================ SITE CONTENT ============================================ */
.ch-site-content { background: var(--ch-warm-white); position: relative; z-index: 2; }

.ch-tile-divider { display: flex; justify-content: center; align-items: center; padding: 20px 0; gap: 12px; }
.ch-tile-divider__line { width: 80px; height: 1px; background: var(--ch-gold-pale); }
.ch-tile-divider__icon { width: 12px; height: 12px; border: 1px solid var(--ch-gold); transform: rotate(45deg); }

.ch-philosophy { padding: var(--ch-section-pad) clamp(24px, 6vw, 120px); text-align: center; background: var(--ch-warm-white); }
.ch-philosophy__eyebrow { font-family: var(--ch-font-body); font-size: 10px; font-weight: 500; letter-spacing: 5px; text-transform: uppercase; color: var(--ch-gold); margin-bottom: 32px; }
.ch-philosophy__heading { font-family: var(--ch-font-display); font-size: clamp(32px, 4vw, 56px); font-weight: 300; line-height: 1.2; color: var(--ch-text-dark); max-width: 900px; margin: 0 auto 40px; }
.ch-philosophy__heading em { font-style: italic; color: var(--ch-gold); }
.ch-philosophy__body { font-family: var(--ch-font-body); font-size: 16px; font-weight: 300; line-height: 2; color: var(--ch-text-muted); max-width: 640px; margin: 0 auto; }

.ch-portfolio { padding: var(--ch-section-pad) 0; background: var(--ch-cream); }
.ch-portfolio__header { text-align: center; padding: 0 24px; margin-bottom: 60px; }
.ch-portfolio__eyebrow { font-family: var(--ch-font-body); font-size: 10px; font-weight: 500; letter-spacing: 5px; text-transform: uppercase; color: var(--ch-gold); margin-bottom: 20px; }
.ch-portfolio__title { font-family: var(--ch-font-display); font-size: clamp(32px, 4vw, 48px); font-weight: 300; color: var(--ch-text-dark); }
.ch-portfolio__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; padding: 0 40px; max-width: var(--ch-content-max); margin: 0 auto; }
.ch-portfolio__item { position: relative; overflow: hidden; cursor: pointer; }
.ch-portfolio__item:nth-child(1) { grid-column: 1 / 8; grid-row: 1 / 3; }
.ch-portfolio__item:nth-child(2) { grid-column: 8 / 13; }
.ch-portfolio__item:nth-child(3) { grid-column: 8 / 13; }
.ch-portfolio__item:nth-child(4) { grid-column: 1 / 6; }
.ch-portfolio__item:nth-child(5) { grid-column: 6 / 13; }
.ch-portfolio__img { width: 100%; height: 100%; min-height: 300px; transition: transform 0.8s cubic-bezier(0.25,0,0.25,1); }
.ch-portfolio__item:hover .ch-portfolio__img { transform: scale(1.05); }
.ch-portfolio__overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(26,26,26,0.8) 0%, transparent 50%); display: flex; flex-direction: column; justify-content: flex-end; padding: 32px; opacity: 0; transition: opacity 0.5s ease; }
.ch-portfolio__item:hover .ch-portfolio__overlay { opacity: 1; }
.ch-portfolio__overlay h3 { font-family: var(--ch-font-display); font-size: 28px; font-weight: 400; color: var(--ch-text-light); margin-bottom: 8px; }
.ch-portfolio__overlay span { font-family: var(--ch-font-body); font-size: 10px; font-weight: 500; letter-spacing: 3px; text-transform: uppercase; color: var(--ch-gold-light); }

.ch-narrative { display: grid; grid-template-columns: 1fr 1fr; min-height: 80vh; }
.ch-narrative__image { position: relative; overflow: hidden; background-size: cover; background-position: center; }
.ch-narrative__image::after { content: ''; position: absolute; inset: 0; background: rgba(26,26,26,0.15); }
.ch-narrative__content { display: flex; flex-direction: column; justify-content: center; padding: clamp(48px, 6vw, 100px); background: var(--ch-charcoal); }
.ch-narrative__eyebrow { font-family: var(--ch-font-body); font-size: 10px; font-weight: 500; letter-spacing: 5px; text-transform: uppercase; color: var(--ch-gold); margin-bottom: 32px; }
.ch-narrative__heading { font-family: var(--ch-font-display); font-size: clamp(32px, 3.5vw, 52px); font-weight: 300; line-height: 1.15; color: var(--ch-text-light); margin-bottom: 32px; }
.ch-narrative__heading em { font-style: italic; color: var(--ch-gold-light); }
.ch-narrative__text { font-family: var(--ch-font-body); font-size: 16px; font-weight: 300; line-height: 2; color: rgba(245,240,230,0.6); margin-bottom: 40px; max-width: 500px; }
.ch-narrative__link { font-family: var(--ch-font-body); font-size: 10px; font-weight: 500; letter-spacing: 3px; text-transform: uppercase; color: var(--ch-gold-light); display: inline-flex; align-items: center; gap: 12px; }
.ch-narrative__link::after { content: ''; width: 40px; height: 1px; background: var(--ch-gold); transition: width 0.3s ease; }
.ch-narrative__link:hover::after { width: 60px; }

.ch-services { padding: var(--ch-section-pad) clamp(24px, 6vw, 120px); background: var(--ch-warm-white); }
.ch-services__header { text-align: center; margin-bottom: 80px; }
.ch-services__eyebrow { font-family: var(--ch-font-body); font-size: 10px; font-weight: 500; letter-spacing: 5px; text-transform: uppercase; color: var(--ch-gold); margin-bottom: 20px; }
.ch-services__title { font-family: var(--ch-font-display); font-size: clamp(32px, 4vw, 48px); font-weight: 300; color: var(--ch-text-dark); }
.ch-services__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 60px; max-width: var(--ch-content-max); margin: 0 auto; }
.ch-service-card { text-align: center; padding: 40px 24px; border: 1px solid transparent; transition: border-color 0.4s ease; }
.ch-service-card:hover { border-color: var(--ch-gold-pale); }
.ch-service-card__icon { width: 48px; height: 48px; margin: 0 auto 28px; }
.ch-service-card__icon svg { width: 100%; height: 100%; stroke: var(--ch-gold); fill: none; stroke-width: 1; }
.ch-service-card__title { font-family: var(--ch-font-display); font-size: 24px; font-weight: 400; color: var(--ch-text-dark); margin-bottom: 16px; }
.ch-service-card__desc { font-family: var(--ch-font-body); font-size: 15px; font-weight: 300; line-height: 1.9; color: var(--ch-text-muted); }

.ch-testimonial { padding: var(--ch-section-pad) clamp(24px, 6vw, 120px); background: var(--ch-charcoal); text-align: center; }
.ch-testimonial__quote { font-family: var(--ch-font-display); font-size: clamp(24px, 3vw, 40px); font-weight: 300; font-style: italic; line-height: 1.5; color: var(--ch-text-light); max-width: 900px; margin: 0 auto 32px; border: none; padding: 0; }
.ch-testimonial__quote::before { content: '\201C'; display: block; font-size: 80px; color: var(--ch-gold); line-height: 0.5; margin-bottom: 24px; }
.ch-testimonial__author { font-family: var(--ch-font-body); font-size: 11px; font-weight: 500; letter-spacing: 3px; text-transform: uppercase; color: var(--ch-gold-light); }

.ch-heritage { display: grid; grid-template-columns: 1fr 1fr; min-height: 70vh; }
.ch-heritage__content { display: flex; flex-direction: column; justify-content: center; padding: clamp(48px, 6vw, 100px); background: var(--ch-cream); }
.ch-heritage__eyebrow { font-family: var(--ch-font-body); font-size: 10px; font-weight: 500; letter-spacing: 5px; text-transform: uppercase; color: var(--ch-gold); margin-bottom: 32px; }
.ch-heritage__heading { font-family: var(--ch-font-display); font-size: clamp(32px, 3.5vw, 52px); font-weight: 300; line-height: 1.15; color: var(--ch-text-dark); margin-bottom: 32px; }
.ch-heritage__heading em { font-style: italic; color: var(--ch-gold); }
.ch-heritage__text { font-family: var(--ch-font-body); font-size: 16px; font-weight: 300; line-height: 2; color: var(--ch-text-muted); max-width: 500px; margin-bottom: 40px; }
.ch-heritage__image { position: relative; background-size: cover; background-position: center; }
.ch-heritage__image::before { content: ''; position: absolute; top: 20px; left: 20px; right: 20px; bottom: 20px; border: 1px solid rgba(184,148,62,0.3); z-index: 1; }

.ch-cta { padding: var(--ch-section-pad) clamp(24px, 6vw, 120px); background: var(--ch-deep-brown); text-align: center; }
.ch-cta__heading { font-family: var(--ch-font-display); font-size: clamp(36px, 4.5vw, 64px); font-weight: 300; line-height: 1.15; color: var(--ch-text-light); margin-bottom: 20px; }
.ch-cta__heading em { font-style: italic; color: var(--ch-gold-light); }
.ch-cta__sub { font-family: var(--ch-font-body); font-size: 16px; font-weight: 300; color: rgba(245,240,230,0.5); margin-bottom: 48px; }
.ch-cta__btn { display: inline-block; font-family: var(--ch-font-body); font-size: 11px; font-weight: 500; letter-spacing: 3px; text-transform: uppercase; color: var(--ch-charcoal); background: var(--ch-gold); padding: 18px 48px; transition: all 0.4s ease; }
.ch-cta__btn:hover { background: var(--ch-gold-light); }

.ch-footer { padding: 56px clamp(24px, 6vw, 120px) 32px; background: var(--ch-charcoal); text-align: center; }
.ch-footer__logo { margin-bottom: 20px; }
.ch-footer__logo img { height: 360px; margin: 0 auto; max-width: 100%; image-rendering: -webkit-optimize-contrast; }
.ch-footer__divider { width: 40px; height: 1px; background: rgba(184,148,62,0.3); margin: 0 auto 40px; }
.ch-footer__social { display: flex; justify-content: center; gap: 28px; margin-bottom: 48px; }
.ch-footer__social a { color: rgba(245,240,230,0.4); transition: color 0.3s ease; display: flex; align-items: center; }
.ch-footer__social a:hover { color: var(--ch-gold); }
.ch-footer__social svg { width: 24px; height: 24px; fill: currentColor; }
.ch-footer__bottom { font-family: var(--ch-font-body); font-size: 12px; font-weight: 300; color: rgba(245,240,230,0.4); letter-spacing: 1px; }

@keyframes chScrollPulse { 0%, 100% { opacity: 0.2; transform: scaleY(0.6); transform-origin: top; } 50% { opacity: 0.6; transform: scaleY(1); } }

.ch-reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease, transform 0.8s ease; }
.ch-reveal.visible { opacity: 1; transform: translateY(0); }

/* ============================================ RESPONSIVE ============================================ */
@media (max-width: 1024px) {
  .ch-narrative, .ch-heritage { grid-template-columns: 1fr; }
  .ch-narrative__image, .ch-heritage__image { min-height: 50vh; }
  .ch-services__grid { grid-template-columns: 1fr; gap: 40px; }
  .ch-portfolio__grid { grid-template-columns: 1fr 1fr; }
  .ch-portfolio__item:nth-child(1) { grid-column: 1 / 3; grid-row: auto; }
  .ch-portfolio__item:nth-child(n) { grid-column: auto; }
}
@media (max-width: 768px) {
  .ch-nav__right { display: none; }
  .ch-nav__hamburger { display: flex; }
  .ch-nav { padding: 20px 24px; }
  .ch-portal__hero-content { left: 24px; bottom: 60px; }
  .ch-portfolio__grid { grid-template-columns: 1fr; padding: 0 24px; }
  .ch-portfolio__item:nth-child(1) { grid-column: 1; }
  .ch-portfolio__overlay { opacity: 1; }
  .ch-services__grid { padding: 0 24px; }
}
