@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@200;300;400;500;600;700&display=swap');

:root {
  --erf-white:  #ffffff;
  --erf-dark:   #1d1e18;
  --erf-accent: #ffffff;
  --erf-ease:   cubic-bezier(0.65, 0, 0.35, 1);
}


/* ══════════════════════════════════════════════════════
   1. LIGHTBOX GRID
   ══════════════════════════════════════════════════════ */

.erf-lg-wrap { width: 100%; }
.erf-lg-grid { display: grid; grid-template-columns: repeat(var(--erf-cols, 3), 1fr); gap: 6px; }
.erf-lg-item { position: relative; overflow: hidden; cursor: pointer; border: none; padding: 0; margin: 0; background: #111; display: block; width: 100%; aspect-ratio: var(--erf-ratio, 1); }
.erf-lg-grid[style*="--erf-ratio:0"] .erf-lg-item { aspect-ratio: auto; }
.erf-lg-item img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; user-select: none; transition: transform 0.6s var(--erf-ease); }
.erf-lg-hover--scale .erf-lg-item:hover img  { transform: scale(1.05); }
.erf-lg-hover--darken .erf-lg-item:hover img { filter: brightness(0.75); }
.erf-lg-hover-veil { position: absolute; inset: 0; pointer-events: none; }
@media (max-width: 900px) { .erf-lg-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .erf-lg-grid { grid-template-columns: 1fr; } }
#erf-lightbox { position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
#erf-lightbox.is-open { opacity: 1; pointer-events: all; }
.erf-lb-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.93); cursor: pointer; }
.erf-lb-stage { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; max-width: 90vw; max-height: 90vh; user-select: none; -webkit-user-select: none; }
.erf-lb-img-wrap { position: relative; line-height: 0; }
.erf-lb-img-wrap::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.erf-lb-img { display: block; max-width: 90vw; max-height: 85vh; object-fit: contain; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.erf-lb-caption { margin-top: 0.7rem; color: rgba(255,255,255,0.5); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; font-family: 'Courier New', monospace; text-align: center; }
.erf-lb-counter { position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.35); font-size: 0.65rem; font-family: 'Courier New', monospace; letter-spacing: 0.15em; pointer-events: none; }
.erf-lb-close { position: fixed; top: 1.4rem; right: 1.6rem; z-index: 2; width: 2.2rem; height: 2.2rem; background: transparent; border: 1px solid rgba(255,255,255,0.3); color: rgba(255,255,255,0.7); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; transition: background 0.25s; }
.erf-lb-close:hover { background: rgba(255,255,255,0.08); border-color: #fff; color: #fff; }
.erf-lb-nav { position: fixed; top: 50%; transform: translateY(-50%); z-index: 2; background: transparent; border: none; color: rgba(255,255,255,0.6); font-size: 2.4rem; cursor: pointer; padding: 0.5rem 1.2rem; transition: color 0.25s; line-height: 1; }
.erf-lb-nav:hover { color: #fff; }
.erf-lb-prev { left: 0.6rem; }
.erf-lb-next { right: 0.6rem; }
.erf-lb-nav:disabled { opacity: 0.2; cursor: default; }


/* ══════════════════════════════════════════════════════
   2. CLEAN SLIDESHOW
   ══════════════════════════════════════════════════════ */

.erf-cs-wrap { position: relative; width: 100%; height: 55vh; overflow: hidden; background: #0a0a0a; }
.erf-cs-track { position: absolute; inset: 0; }
.erf-cs-slide { position: absolute; inset: 0; opacity: 0; transition: opacity var(--erf-trans, 900ms) ease; will-change: opacity; }
.erf-cs-slide.erf-cs-active { opacity: 1; }
.erf-cs-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
.erf-cs-empty { background: #111; }
.erf-cs-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 10; background: transparent; border: none; color: #ffffff; font-size: 22px; cursor: pointer; padding: 1.2rem 1rem; line-height: 1; opacity: 0.6; transition: opacity 0.25s; }
.erf-cs-btn:hover { opacity: 1; }
.erf-cs-prev { left: 0.8rem; }
.erf-cs-next { right: 0.8rem; }
@media (max-width: 600px) { .erf-cs-wrap { height: 38vh; } .erf-cs-btn { font-size: 1.4rem; padding: 0.8rem 0.6rem; } }


/* ══════════════════════════════════════════════════════
   3. PORTFOLIO BANNERS
   CSS Grid (not flex) for reliable equal columns in Elementor.
   White gap. Text BOTTOM LEFT on hover.
   ══════════════════════════════════════════════════════ */

/* Outer column grid — white gap shows between rows */
.erf-pb-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  background: #000000;
  width: 100%;
}

/* Side-by-side row — two equal columns */
.erf-pb-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: #000000;
}

/* Every panel — same height regardless of full/half */
.erf-pb-item {
  display: block;
  width: 100%;
  height: 50vh;
  position: relative;
  overflow: hidden;
  background: #000;
}

/* Inner <a> pinned to all four edges of the panel */
.erf-pb-inner {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  text-decoration: none;
  overflow: hidden;
}

/* Cover image */
.erf-pb-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  z-index: 1;
  transition: transform 0.9s var(--erf-ease);
}
.erf-pb-item:hover .erf-pb-bg { transform: scale(1.03); }

/* Hover video */
.erf-pb-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.erf-pb-item:hover .erf-pb-video { opacity: 1; }

/* ── Text: BOTTOM LEFT ── */
.erf-pb-content {
  position: absolute;
  top: auto;
  right: auto;
  bottom: 4vw;
  left: 4vw;
  z-index: 10;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   FULL-BLEED ALL ERF CONTENT WIDGETS
   Every ERF widget breaks out to true viewport width at the
   .elementor-widget- level (which always exists — no :has()
   needed). This guarantees every widget's internal 4vw padding
   is measured from the SAME reference: the true viewport edge.
   Result: hero title, portfolio title, about hero, services,
   content block, and contact form all align at exactly 4vw.
   ═══════════════════════════════════════════════════════ */
.elementor-widget-erf_hero,
.elementor-widget-erf_portfolio_reel,
.elementor-widget-erf_contact_form,
.elementor-widget-erf_about_hero,
.elementor-widget-erf_services_grid,
.elementor-widget-erf_content_block,
.elementor-widget-erf_split_section,
.elementor-widget-erf_page_hero,
.elementor-widget-erf_photo_fade,
.elementor-widget-erf_contact_links {
  width: 100vw !important;
  max-width: 100vw !important;
  position: relative !important;
  top: auto !important;
  left: 50% !important;
  right: 50% !important;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  padding: 0 !important;
}

/* Prevent split section's parent from creating a stacking context that causes overlap */
.elementor-section:has(.elementor-widget-erf_split_section),
.e-con:has(.elementor-widget-erf_split_section) {
  overflow: visible !important;
  position: static !important;
}
.elementor-widget-erf_hero > .elementor-widget-container,
.elementor-widget-erf_portfolio_reel > .elementor-widget-container,
.elementor-widget-erf_contact_form > .elementor-widget-container,
.elementor-widget-erf_about_hero > .elementor-widget-container,
.elementor-widget-erf_services_grid > .elementor-widget-container,
.elementor-widget-erf_content_block > .elementor-widget-container,
.elementor-widget-erf_split_section > .elementor-widget-container,
.elementor-widget-erf_page_hero > .elementor-widget-container,
.elementor-widget-erf_photo_fade > .elementor-widget-container,
.elementor-widget-erf_contact_links > .elementor-widget-container {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}

/* Footer: container-safe. No viewport breakout (it can be nested
   in containers/columns where -50vw would throw it off-screen).
   It fills its parent and uses its own 4vw internal padding. */
.elementor-widget-erf_footer {
  width: 100% !important;
  max-width: 100% !important;
}
.elementor-widget-erf_footer > .elementor-widget-container {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}

.erf-pb-type {
  display: block;
  font-family: 'Kanit', sans-serif;
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.erf-pb-title {
  display: block;
  font-family: 'Kanit', sans-serif;
  font-weight: 200;
  letter-spacing: -0.01em;
  line-height: 1;
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.erf-pb-title { font-size: clamp(1.4rem, 2.6vw, 3.8rem); }

.erf-pb-item:hover .erf-pb-title,
.erf-pb-item:hover .erf-pb-type { opacity: 1; }

@media (hover: none) {
  .erf-pb-title, .erf-pb-type { opacity: 1; }
}

@media (max-width: 767px) {
  /* Stack side-by-side rows into single column */
  .erf-pb-row { grid-template-columns: 1fr !important; gap: 4px; }

  /* 16:9 aspect ratio — matches altcinc mobile exactly */
  .erf-pb-item { height: 56.25vw !important; min-height: 180px; }

  /* Title always visible on mobile (no hover on touch) */
  .erf-pb-title { font-size: 5.5vw !important; opacity: 1 !important; }
  .erf-pb-type  { font-size: 8px !important; opacity: 1 !important; letter-spacing: 0.15em; }
  .erf-pb-content { left: 1.5rem; bottom: 1.5rem; }

  /* Remove gap to be edge-to-edge */
  .erf-pb-wrap { gap: 4px; }
}


/* ══════════════════════════════════════════════════════
   4. HERO WIDGET
   ══════════════════════════════════════════════════════ */

.erf-hero-wrap {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: flex-end;
}

.erf-hero-video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}

.erf-hero-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.erf-hero-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  opacity: 0.45;
  z-index: 1;
}

/* Logo mark + studio name — top left */
.erf-hero-brand {
  position: absolute;
  top: 1.8rem;
  left: 2.5rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
}

.erf-hero-brand-name {
  font-family: 'Kanit', sans-serif;
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
}

/* Main content — bottom left */
.erf-hero-content {
  position: relative;
  z-index: 10;
  padding: 0 4vw 4vw;
  max-width: 860px;
}

.erf-hero-eyebrow {
  display: block;
  font-family: 'Kanit', sans-serif;
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 1rem;
}

.erf-hero-title {
  font-family: 'Kanit', sans-serif;
  font-size: clamp(2.8rem, 8vw, 9rem);
  font-weight: 500;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0 0 1.2rem;
}

.erf-hero-accent {
  font-style: normal;
  color: #ffffff;
}

.erf-hero-sub {
  font-family: 'Kanit', sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  color: rgba(255,255,255,0.38);
  letter-spacing: 0.05em;
  margin-bottom: 1.8rem;
}

.erf-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: 'Kanit', sans-serif;
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #ffffff;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.45);
  padding: 0.85rem 2.5rem;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}
.erf-hero-cta:hover {
  border-color: #ffffff;
  background: #ffffff;
  color: #1d1e18;
}

/* Scroll indicator — bottom right */
.erf-hero-scroll {
  position: absolute;
  right: 2.5rem;
  bottom: 2.2rem;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.erf-hero-scroll-label {
  font-family: 'Kanit', sans-serif;
  font-size: 0.5rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  writing-mode: vertical-rl;
}

.erf-hero-scroll-track {
  display: block;
  width: 1px;
  height: 44px;
  background: rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
}

.erf-hero-scroll-fill {
  display: block;
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: #ffffff;
  animation: erfHeroScroll 2s ease-in-out infinite;
}

@keyframes erfHeroScroll {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(350%); }
}

@media (max-width: 600px) {
  .erf-hero-title { font-size: clamp(2rem, 12vw, 4rem); }
  .erf-hero-content { padding: 0 1.5rem 3rem; }
  .erf-hero-scroll  { display: none; }
}


/* ══════════════════════════════════════════════════════
   5. CONTACT FORM WIDGET
   ══════════════════════════════════════════════════════ */

.erf-cf-wrap {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.erf-cf-intro {
  font-family: 'Kanit', sans-serif;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  font-weight: 200;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 3rem;
}

/* Dark scheme */
.erf-cf--dark .erf-cf-intro { color: #ffffff; }
.erf-cf--dark .erf-cf-label { color: rgba(255,255,255,0.4); }
.erf-cf--dark .erf-cf-input { color: #ffffff; border-bottom-color: rgba(255,255,255,0.15); }
.erf-cf--dark .erf-cf-input::placeholder { color: rgba(255,255,255,0.18); }
.erf-cf--dark .erf-cf-select option { background: #000; color: #fff; }

/* Light scheme */
.erf-cf--light .erf-cf-intro { color: #1d1e18; }
.erf-cf--light .erf-cf-label { color: rgba(0,0,0,0.4); }
.erf-cf--light .erf-cf-input { color: #1d1e18; border-bottom-color: rgba(0,0,0,0.15); }
.erf-cf--light .erf-cf-input::placeholder { color: rgba(0,0,0,0.2); }

/* Form layout */
.erf-cf-form  { display: flex; flex-direction: column; gap: 2rem; }

.erf-cf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.erf-cf-field { display: flex; flex-direction: column; gap: 0.5rem; }

.erf-cf-label {
  font-family: 'Kanit', sans-serif;
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.erf-cf-req { font-size: 0.65rem; }

.erf-cf-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid;
  padding: 0.6rem 0;
  font-family: 'Kanit', sans-serif;
  font-size: 1rem;
  font-weight: 300;
  outline: none;
  width: 100%;
  transition: border-bottom-color 0.2s;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
}

.erf-cf-select {
  cursor: pointer;
  padding-right: 1.2rem;
}

.erf-cf-textarea { resize: vertical; min-height: 130px; }

.erf-cf-footer {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.erf-cf-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  background: transparent;
  border: 1px solid #ffffff;
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.75rem 1.6rem;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.erf-cf-btn:hover { background: #ffffff; color: #1d1e18; }
.erf-cf-btn:disabled { opacity: 0.5; cursor: default; }

.erf-cf-btn-arrow { transition: transform 0.25s; }
.erf-cf-btn:hover .erf-cf-btn-arrow { transform: translateX(4px); }

.erf-cf-status {
  font-family: 'Kanit', sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  min-height: 1.2em;
}
.erf-cf-status--ok  { color: rgba(255,255,255,0.9); letter-spacing: 0.08em; }
.erf-cf-status--err { color: #e74c3c; }

@media (max-width: 600px) {
  .erf-cf-row { grid-template-columns: 1fr; }
}


/* ══════════════════════════════════════════════════════
   Smooth scroll (all anchor links)
   ══════════════════════════════════════════════════════ */
html { scroll-behavior: smooth; }




/* ══════════════════════════════════════════════════════
   6. SPLIT SECTION
   ══════════════════════════════════════════════════════ */

.erf-sps-heading {
  font-family: 'Kanit', sans-serif !important;
  font-size: 4vw;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #1d1e18;
  margin: 0;
}

.erf-sps-body {
  font-family: 'Kanit', sans-serif !important;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
  color: #444;
  margin: 0 0 2rem;
}

.erf-sps-link {
  font-family: 'Kanit', sans-serif !important;
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1d1e18;
  text-decoration: none !important;
  border-bottom: 1px solid transparent !important;
  padding-bottom: 2px;
  display: inline-block;
  transition: border-color 0.25s ease !important;
}

.erf-sps-link:hover {
  border-bottom-color: currentColor !important;
}

/* Fade image into page background at top and bottom edges */
.erf-sps-image-block {
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 22%,
    black 78%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 22%,
    black 78%,
    transparent 100%
  );
}

@media (max-width: 960px) {
  .erf-sps-heading { font-size: 9vw; }
}


/* ══════════════════════════════════════════════════════
   Portfolio CTA button
   ══════════════════════════════════════════════════════ */
.erf-pb-cta-wrap {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 4vw;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.erf-pb-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-family: 'Kanit', sans-serif;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ffffff;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 0.85rem 2.5rem;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}

.erf-pb-cta:hover {
  border-color: #ffffff;
  background: #ffffff;
  color: #1d1e18;
}

.erf-pb-cta-arrow {
  transition: transform 0.25s;
}
.erf-pb-cta:hover .erf-pb-cta-arrow {
  transform: translateX(4px);
}


/* ══════════════════════════════════════════════════════
   Footer Widget
   ══════════════════════════════════════════════════════ */
.erf-fw-wrap {
  padding: 2.5rem 4vw 2rem;
  background-color: #f5f5f0;
  font-family: 'Kanit', sans-serif;
}

.erf-fw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
}

.erf-fw-label {
  font-family: 'Kanit', sans-serif;
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.35);
  margin: 0 0 0.7rem;
}

.erf-fw-rule {
  height: 1px;
  background: rgba(0,0,0,0.12);
  margin-bottom: 1.2rem;
}

.erf-fw-copy {
  font-family: 'Kanit', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1d1e18;
  margin: 0;
  letter-spacing: 0.04em;
}

.erf-fw-link {
  font-family: 'Kanit', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1d1e18;
  text-decoration: none;
  letter-spacing: 0.04em;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: border-color 0.2s;
}
.erf-fw-link:hover { border-bottom-color: currentColor; }

.erf-fw-social {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.erf-fw-social-link {
  font-family: 'Kanit', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1d1e18;
  text-decoration: none;
  letter-spacing: 0.04em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
  align-self: flex-start;
}
.erf-fw-social-link:hover { border-bottom-color: currentColor; }

@media (max-width: 600px) {
  .erf-fw-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}


/* ══════════════════════════════════════════════════════
   Hero title — glitch hover effect
   ══════════════════════════════════════════════════════ */

.erf-hero-title { cursor: default; }

.erf-hero-title:hover {
  animation: erf-glitch 2.5s infinite;
}

@keyframes erf-glitch {
  0%, 84%, 94%, 100% {
    transform: none;
    text-shadow: none;
    filter: none;
  }

  /* Burst 1 */
  85% {
    transform: translateX(-4px);
    text-shadow: 3px 0 rgba(255, 30, 30, 0.75), -2px 0 rgba(30, 30, 255, 0.75);
    filter: brightness(1.12);
  }
  86% {
    transform: translateX(4px) skewX(-1.5deg);
    text-shadow: -3px 0 rgba(255, 30, 30, 0.6), 2px 0 rgba(30, 30, 255, 0.6);
    filter: contrast(1.15);
  }
  87% {
    transform: translateX(-2px) skewX(0.8deg);
    text-shadow: 1px 0 rgba(255, 30, 30, 0.4);
    filter: none;
  }
  88% {
    transform: none;
    text-shadow: none;
  }

  /* Burst 2 — shorter, offset */
  90% {
    transform: translateX(3px);
    text-shadow: -2px 0 rgba(0, 200, 255, 0.5), 2px 0 rgba(255, 0, 100, 0.5);
    filter: brightness(1.08) saturate(1.4);
  }
  91% {
    transform: translateX(-1px) skewX(1deg);
    filter: none;
  }
  92% {
    transform: none;
    text-shadow: none;
  }
}


/* ══════════════════════════════════════════════════════
   MOBILE FIXES
   ══════════════════════════════════════════════════════ */

/* Hero title — much larger on mobile */
@media (max-width: 767px) {
  .erf-hero-title {
    font-size: 11vw !important;
    line-height: 1.05 !important;
  }
  .erf-hero-content {
    padding: 0 1.5rem 3rem !important;
  }
  /* Ensure hero starts at very top on mobile */
  .erf-hero-wrap {
    min-height: 100svh;
  }
}

/* Video player — prevent parent clipping on mobile */
.elementor-widget-erf_video_player,
.elementor-widget-erf_video_player > .elementor-widget-container {
  overflow: visible !important;
  height: auto !important;
}

/* Split section — prevent image bleeding out on mobile */
@media (max-width: 768px) {
  .erf-sps-wrap {
    overflow: hidden !important;
  }
  .erf-sps-center {
    overflow: hidden !important;
  }
}


/* ══════════════════════════════════════════════════════
   ELEMENTOR WIDGET CONTAINER RESETS
   Zero out default padding Elementor adds inside widgets,
   so each widget controls its own spacing consistently.
   ══════════════════════════════════════════════════════ */
.elementor-widget-erf_contact_form > .elementor-widget-container,
.elementor-widget-erf_about_hero > .elementor-widget-container,
.elementor-widget-erf_services_grid > .elementor-widget-container,
.elementor-widget-erf_content_block > .elementor-widget-container,
.elementor-widget-erf_split_section > .elementor-widget-container,
.elementor-widget-erf_portfolio_reel > .elementor-widget-container,
.elementor-widget-erf_photo_fade > .elementor-widget-container,
.elementor-widget-erf_page_hero > .elementor-widget-container,
.elementor-widget-erf_contact_links > .elementor-widget-container,
.elementor-widget-erf_footer > .elementor-widget-container {
  padding: 0 !important;
  margin: 0 !important;
}


/* ══════════════════════════════════════════════════════
   GLOBAL SCROLL REVEAL SYSTEM — 2026
   ══════════════════════════════════════════════════════ */

/* Clip-path wipe: elements that reveal upward */
[data-erf-clip]{
  clip-path: inset(0 0 100% 0);
  will-change: clip-path;
}
[data-erf-clip].erf-in{
  clip-path: inset(0 0 0% 0);
  transition: clip-path 0.85s cubic-bezier(.16,1,.3,1);
}

/* Fade + rise: body text, subtitles */
[data-erf-up]{
  opacity:0;
  transform:translateY(22px);
  will-change:opacity,transform;
}
[data-erf-up].erf-in{
  opacity:1;
  transform:translateY(0);
  transition:opacity 0.7s ease, transform 0.7s cubic-bezier(.16,1,.3,1);
}

/* Horizontal rule scale-in */
[data-erf-rule]{
  transform:scaleX(0);
  transform-origin:left center;
  will-change:transform;
}
[data-erf-rule].erf-in{
  transform:scaleX(1);
  transition:transform 0.9s cubic-bezier(.16,1,.3,1);
}

/* Stagger delays (applied via data-erf-delay attribute in JS) */
.erf-d1{ transition-delay:0.08s !important; }
.erf-d2{ transition-delay:0.18s !important; }
.erf-d3{ transition-delay:0.28s !important; }
.erf-d4{ transition-delay:0.4s  !important; }


/* ══════════════════════════════════════════════════════
   BUTTON GLITCH — 2026
   Applied to all ERF CTAs on hover via a data attr
   ══════════════════════════════════════════════════════ */
@keyframes erf-glitch-1{
  0%  { clip-path:inset(30% 0 60% 0); transform:translateX(-3px); }
  20% { clip-path:inset(70% 0 5%  0); transform:translateX(3px);  }
  40% { clip-path:inset(5%  0 80% 0); transform:translateX(-2px); }
  60% { clip-path:inset(50% 0 30% 0); transform:translateX(2px);  }
  80% { clip-path:inset(15% 0 50% 0); transform:translateX(-1px); }
  100%{ clip-path:inset(0 0 0 0);     transform:translateX(0);     }
}
/* Short glitch burst on entry, then settle — applied via JS */
.erf-btn-glitch::before{
  content:attr(data-text);
  position:absolute;inset:0;
  display:flex;align-items:center;justify-content:center;
  pointer-events:none;
  opacity:0;
}
.erf-btn-glitch:hover::before{
  opacity:1;
  color:inherit;
  animation:erf-glitch-1 0.28s steps(1) forwards;
  mix-blend-mode:difference;
}


/* ═══════════════════════════════════════════════════════
   ELEMENTOR PADDING NULLIFIER
   Zeroes all Elementor section/container/column padding
   for any section containing an ERF widget.
   Ensures all widget text starts at exactly 4vw from 
   the true viewport edge — not 4vw + Elementor padding.
   ═══════════════════════════════════════════════════════ */

/* Old Elementor (section > container > row > column > widget-wrap) */
.elementor-section:has([class*="elementor-widget-erf_"]),
.elementor-top-section:has([class*="elementor-widget-erf_"]) {
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.elementor-section:has([class*="elementor-widget-erf_"]) > .elementor-container {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.elementor-section:has([class*="elementor-widget-erf_"]) .elementor-column {
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.elementor-section:has([class*="elementor-widget-erf_"]) .elementor-widget-wrap {
    padding: 0 !important;
}
/* New Elementor flex containers */
.e-con:has([class*="elementor-widget-erf_"]),
.e-con-inner:has([class*="elementor-widget-erf_"]) {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100% !important;
    --padding-inline-start: 0px !important;
    --padding-inline-end: 0px !important;
}


/* ══════════════════════════════════════════════════════
   PORTFOLIO GRAYSCALE-SIBLINGS FEATURE
   When .erf-pb-wrap has [data-erf-gs="1"], hovering any
   item fades all OTHER items to black & white.
   Toggle via Elementor custom attribute: data-erf-gs = 1
   ══════════════════════════════════════════════════════ */

/* When the feature is ON and any item is hovered,
   dim siblings to grayscale */
.erf-pb-wrap[data-erf-gs="1"]:has(.erf-pb-item:hover) .erf-pb-item:not(:hover) .erf-pb-bg,
.erf-pb-wrap[data-erf-gs="1"]:has(.erf-pb-item:hover) .erf-pb-item:not(:hover) .erf-pb-video {
  filter: grayscale(1) brightness(0.55);
  transition: filter 0.45s ease;
}

/* Smooth transition back when nothing is hovered */
.erf-pb-wrap[data-erf-gs="1"] .erf-pb-item .erf-pb-bg,
.erf-pb-wrap[data-erf-gs="1"] .erf-pb-item .erf-pb-video {
  transition: filter 0.45s ease, transform 0.9s var(--erf-ease), opacity 0.4s ease;
}

/* No grayscale on touch devices (no hover state) */
@media (hover: none) {
  .erf-pb-wrap[data-erf-gs="1"]:has(.erf-pb-item:hover) .erf-pb-item:not(:hover) .erf-pb-bg,
  .erf-pb-wrap[data-erf-gs="1"]:has(.erf-pb-item:hover) .erf-pb-item:not(:hover) .erf-pb-video {
    filter: none;
  }
}


/* ══════════════════════════════════════════════════════
   MOBILE IMPROVEMENTS — 2026 PASS
   ══════════════════════════════════════════════════════ */

/* Hero — tighten eyebrow + sub on mobile */
@media (max-width: 600px) {
  .erf-hero-eyebrow { font-size: 0.55rem; letter-spacing: 0.18em; margin-bottom: 0.7rem; }
  .erf-hero-sub { font-size: 0.65rem; }
  .erf-hero-cta { padding: 0.75rem 1.6rem; font-size: 0.62rem; }
  .erf-hero-brand { top: 1.2rem; left: 1.5rem; }
}

/* Contact form — full-width btn on mobile */
@media (max-width: 600px) {
  .erf-cf-wrap { padding: 0 1.5rem; }
  .erf-cf-btn { width: 100%; justify-content: center; padding: 1rem 1.6rem; }
  .erf-cf-footer { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .erf-cf-status { font-size: 0.7rem; }
}

/* Footer — already stacks on mobile, improve spacing */
@media (max-width: 600px) {
  .erf-fw-wrap { padding: 2rem 1.5rem 1.5rem; }
  .erf-fw-grid { gap: 2rem; }
}

/* Portfolio CTA — full width on mobile */
@media (max-width: 600px) {
  .erf-pb-cta-wrap { padding: 2rem 1.5rem; }
  .erf-pb-cta { width: 100%; justify-content: center; }
}

/* Split section heading — tighter on mobile */
@media (max-width: 600px) {
  .erf-sps-heading { font-size: 10vw !important; }
  .erf-sps-body { font-size: 0.95rem; }
}

/* About hero, page hero — ensure safe viewport units on mobile */
@media (max-width: 767px) {
  .erf-ph-wrap { min-height: 50svh; }
}

/* Lightbox — better touch targets on mobile */
@media (max-width: 600px) {
  .erf-lb-close { width: 2.8rem; height: 2.8rem; top: 0.8rem; right: 0.8rem; }
  .erf-lb-nav { font-size: 2rem; padding: 0.8rem 0.7rem; }
  .erf-lb-stage { max-width: 96vw; }
  .erf-lb-img { max-height: 78vh; }
}

/* Services grid — single column on small screens */
@media (max-width: 480px) {
  .erf-sg-grid { grid-template-columns: 1fr !important; }
}

/* Contact links — stack vertically, reduce font size on mobile */
@media (max-width: 600px) {
  .erf-cl-email { font-size: clamp(2rem, 12vw, 4rem) !important; }
}

/* Prevent horizontal scroll from full-bleed widgets on iOS */
body { overflow-x: hidden; }

/* Safe area padding for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .erf-hero-content { padding-bottom: calc(4vw + env(safe-area-inset-bottom)); }
  .erf-fw-wrap { padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }
}

/* ══════════════════════════════════════════════════════
   CRITICAL MOBILE HEADER FIXES — v2
   ══════════════════════════════════════════════════════ */

/*
   The ERF header is position:fixed. On mobile the body needs
   padding-top so content doesn't hide behind it.
   JS sets --erf-hdr-h on <html> after measuring the header height.
   If JS hasn't run yet, 72px is a safe fallback.
*/
:root { --erf-hdr-h: 72px; }

/* Push page content below the fixed header — but NOT when the first section is the hero */
body > .elementor > .elementor-section:first-child:not(:has(.elementor-widget-erf_hero)),
body > div > .elementor > .elementor-section:first-child:not(:has(.elementor-widget-erf_hero)),
#page,
#content,
.site-main {
  padding-top: var(--erf-hdr-h, 72px) !important;
}

/* Exception: the header widget itself must NOT be pushed */
.elementor-widget-erf_header,
.elementor-widget-erf_header > .elementor-widget-container {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Hero sits flush under the transparent fixed header — no offset needed */

/* On mobile, clamp the title size so it never bleeds into the header */
@media (max-width: 767px) {
  .erf-hero-title {
    font-size: clamp(2rem, 10vw, 3.5rem) !important;
    line-height: 1.08 !important;
  }
  .erf-hero-content {
    padding: 0 1.5rem 3.5rem !important;
    max-width: 100% !important;
  }
  /* Scroll indicator off on mobile (saves space) */
  .erf-hero-scroll { display: none !important; }
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 768px) {
  .erf-hero-title {
    font-size: clamp(2.5rem, 7vw, 5rem) !important;
  }
}



/* ══════════════════════════════════════════════════════
   MOBILE SMOOTH SCROLL WRAPPER OVERRIDE
   When ScrollSmoother loads on mobile despite PHP dequeue,
   this CSS forces normal layout. Uses !important on ALL
   properties the JS sets via inline style.
   ══════════════════════════════════════════════════════ */
/* Fix ScrollSmoother on ALL screen sizes — it was clipping the page to one viewport height */
#smooth-wrapper {
  position: static !important;
  overflow: visible !important;
  height: auto !important;
  width: 100% !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
}
#smooth-content {
  transform: none !important;
  will-change: auto !important;
  position: static !important;
  overflow: visible !important;
}
html, body {
  overflow: auto !important;
  height: auto !important;
}

/* ══════════════════════════════════════════════════════
   NUCLEAR Z-INDEX — HEADER ALWAYS ON TOP
   Elementor sections, Slider Revolution, and portfolio
   items can all create stacking contexts. This block
   forces the ERF header and mobile menu above all of them.
   ══════════════════════════════════════════════════════ */

/* Force ALL Elementor sections/containers below header */
.elementor-section,
.elementor-top-section,
.e-con,
.e-con-inner,
.elementor-widget-wrap,
.elementor-widget-container {
  /* Do NOT set z-index here — that would create stacking contexts.
     Instead, ensure nothing creates an elevated stacking context
     that could override a fixed positioned element. */
  isolation: auto !important;
}

/* Portfolio items: remove will-change so they don't form stacking contexts */
.erf-pb-item,
.erf-pb-inner,
.erf-pb-bg,
.erf-pb-video {
  will-change: auto !important;
  /* Keep transform for scale effect but don't let it elevate z */
}
/* Re-apply transforms without will-change */
.erf-pb-item:hover .erf-pb-bg { transform: scale(1.03); }

/* Slider Revolution: ensure it sits below header */
.rev_slider_wrapper,
.rev-slider,
#rev_slider_wrapper,
.tp-banner-container {
  z-index: 1 !important;
}

/* Mobile: explicit rule so nothing from the page bleeds through */
@media (max-width: 1024px) {
  [id^="erfhdr_"] {
    z-index: 99999 !important;
    background: #000000 !important;
  }
  [id$="-menu"] {
    z-index: 99998 !important;
  }
}
