/* =========================================================
   Treflyn Barn — SIGNATURE v2.0
   Boutique-hotel homepage transformation
   ========================================================= */

html.tb-signature {
  --sig-gold: #d4b07a;
  --sig-gold-bright: #f0d7b0;
  --sig-ink: #0a100e;
  --sig-mist: rgba(255, 252, 248, 0.06);
  --sig-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sig-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* —— Global atmosphere —— */
body.tb-front.tb-signature-ready {
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(201, 166, 107, 0.07), transparent 50%),
    var(--ivory);
}

body.tb-front.tb-signature-ready::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* Custom luxury cursor removed — native OS pointer only. */
.sig-cursor,
.sig-cursor-dot,
.cursor-glow {
  display: none !important;
  pointer-events: none !important;
}

html.tb-signature.sig-cursor-on body.tb-front,
html.tb-signature.sig-cursor-on body.tb-front *,
html.sig-cursor-on body,
html.sig-cursor-on body * {
  cursor: auto !important;
}

/* —— Hero: cinematic frame —— */
.hero.sig-hero {
  min-height: 100vh;
  min-height: 100dvh;
}

.hero-frame {
  position: absolute;
  inset: 1.25rem;
  z-index: 4;
  pointer-events: none;
  border: 1px solid rgba(224, 196, 154, 0.18);
  border-radius: 4px;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 1.2s var(--sig-ease), transform 1.4s var(--sig-ease);
}

body.tb-ready .hero-frame {
  opacity: 1;
  transform: scale(1);
}

.hero-frame::before,
.hero-frame::after,
.hero-frame span::before,
.hero-frame span::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--sig-gold);
  border-style: solid;
}

.hero-frame::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}
.hero-frame::after {
  top: -1px;
  right: -1px;
  border-width: 2px 2px 0 0;
}
.hero-frame span {
  position: absolute;
  inset: 0;
}
.hero-frame span::before {
  bottom: -1px;
  left: -1px;
  border-width: 0 0 2px 2px;
}
.hero-frame span::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

@media (max-width: 720px) {
  .hero-frame {
    inset: 0.65rem;
  }
}

/* Hero title scale */
body.tb-front .hero h1 {
  font-size: clamp(3.1rem, 7.5vw, 5.4rem) !important;
  line-height: 0.98 !important;
  letter-spacing: -0.03em !important;
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}

body.tb-front .hero h1 em {
  font-weight: 400;
  font-style: italic;
}

/* Hero lead glow */
body.tb-front .hero .lead {
  font-size: clamp(1.05rem, 1.6vw, 1.18rem) !important;
  line-height: 1.65;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* Floating side label */
.hero-side-label {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  z-index: 5;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(224, 196, 154, 0.55);
  white-space: nowrap;
  pointer-events: none;
}

@media (max-width: 1100px) {
  .hero-side-label {
    display: none;
  }
}

/* —— Header luxury —— */
body.tb-front .site-header {
  border-bottom: 1px solid transparent;
}

body.tb-front .site-header.scrolled {
  border-bottom-color: rgba(201, 166, 107, 0.15) !important;
}

body.tb-front .logo-name {
  letter-spacing: 0.04em;
}

/* —— Buttons: liquid gold —— */
body.tb-front .btn-gold {
  background: linear-gradient(
    135deg,
    #b89255 0%,
    #d4b07a 40%,
    #f0d7b0 50%,
    #c9a66b 60%,
    #a8874f 100%
  ) !important;
  background-size: 200% 200% !important;
  color: #0f1c16 !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em;
  border: 0 !important;
  box-shadow:
    0 10px 30px rgba(168, 135, 79, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
  transition: background-position 0.6s var(--sig-ease), transform 0.35s var(--sig-ease),
    box-shadow 0.35s !important;
}

body.tb-front .btn-gold:hover {
  background-position: 100% 50% !important;
  transform: translateY(-2px) !important;
  box-shadow:
    0 16px 40px rgba(168, 135, 79, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
}

body.tb-front .btn-primary {
  box-shadow: 0 12px 32px rgba(15, 28, 22, 0.18);
}

body.tb-front .btn-ghost {
  border-color: rgba(240, 215, 176, 0.45) !important;
  backdrop-filter: blur(8px);
}

body.tb-front .btn-ghost:hover {
  background: rgba(255, 252, 248, 0.12) !important;
  border-color: var(--sig-gold-bright) !important;
}

/* —— Section type (padding owned by flow.css) —— */
body.tb-front .section-head h2 {
  font-size: clamp(2.2rem, 4.2vw, 3.15rem) !important;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

body.tb-front .eyebrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

body.tb-front .eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--champagne);
}

/* —— Reveal: soft only — never clip/hide images permanently —— */
body.tb-front.js-reveal .reveal:not(.visible) {
  opacity: 0.001;
  filter: none;
  transform: translateY(20px);
  /* no clip-path — clip was hiding photos if JS stalled */
}

body.tb-front.js-reveal .reveal.visible {
  opacity: 1;
  filter: none;
  transform: none;
  transition: opacity 0.85s var(--sig-ease), transform 0.85s var(--sig-ease);
}

/* Fail-safe: after paint, never leave media blank */
body.tb-front img,
body.tb-front .exp-visual,
body.tb-front .final-cta-bg,
body.tb-front .hero-slide img {
  opacity: 1 !important;
  visibility: visible !important;
  clip-path: none !important;
}

body.tb-front .hero-slide:not(.active) {
  opacity: 0 !important;
}

body.tb-front .hero-slide.active {
  opacity: 1 !important;
}

/* —— Trust bar: richer —— */
body.tb-front .trust-bar {
  position: relative;
  overflow: hidden;
}

body.tb-front .trust-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(201, 166, 107, 0.08),
    transparent
  );
  animation: trustSweep 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes trustSweep {
  0%,
  100% {
    transform: translateX(-30%);
  }
  50% {
    transform: translateX(30%);
  }
}

/* —— Stats: glass diamond —— */
body.tb-front .stats-band-inner {
  background:
    linear-gradient(145deg, rgba(255, 252, 248, 0.98), rgba(243, 236, 224, 0.95)) !important;
  border: 1px solid rgba(201, 166, 107, 0.35) !important;
  box-shadow:
    0 30px 70px rgba(15, 20, 16, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset,
    0 1px 0 rgba(201, 166, 107, 0.3) !important;
}

body.tb-front .stat-value {
  background: linear-gradient(180deg, #1a2e24, #0f1c16);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* —— Promise cards: elevated —— */
body.tb-front .promise-card {
  border-radius: 18px !important;
  background:
    linear-gradient(165deg, #fffcf8 0%, #f6f0e6 100%) !important;
  box-shadow: 0 4px 0 rgba(201, 166, 107, 0.15), 0 16px 40px rgba(15, 20, 16, 0.06);
  transition: transform 0.5s var(--sig-ease), box-shadow 0.5s !important;
}

body.tb-front .promise-card:hover {
  transform: translateY(-10px) !important;
  box-shadow:
    0 4px 0 rgba(201, 166, 107, 0.35),
    0 28px 56px rgba(15, 20, 16, 0.12) !important;
}

/* —— About: magazine layout polish —— */
body.tb-front .about-images .main {
  border-radius: 22px !important;
  overflow: hidden;
  position: relative;
}

body.tb-front .about-images .main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 1px solid rgba(255, 252, 248, 0.15);
  border-radius: inherit;
  pointer-events: none;
}

body.tb-front .about-images .main img {
  transition: transform 1.2s var(--sig-ease), filter 0.6s !important;
}

body.tb-front .about-images .main:hover img {
  transform: scale(1.05) !important;
  filter: saturate(1.08) contrast(1.04);
}

/* —— Gallery: keep original aspect-ratio grid (bento broke empty tiles) —— */
body.tb-front .gallery-grid {
  gap: 0.7rem !important;
}

body.tb-front .gallery-item {
  border-radius: 16px !important;
  overflow: hidden !important;
  background: #cfc6b8 !important;
}

body.tb-front .gallery-item img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  opacity: 1 !important;
  visibility: visible !important;
  clip-path: none !important;
  transform: none;
}

/* —— Filmstrip: premium cinema —— */
body.tb-front .film-card {
  border-radius: 20px !important;
  box-shadow: 0 20px 50px rgba(8, 14, 11, 0.2) !important;
}

body.tb-front .film-card img {
  height: 280px !important;
}

/* —— Day rhythm: starfield ready —— */
body.tb-front .day-rhythm {
  border: 1px solid rgba(201, 166, 107, 0.2);
  border-radius: 28px !important;
}

/* —— Reviews featured: theater —— */
body.tb-front .rf-viewport {
  border-radius: 24px !important;
  border: 1px solid rgba(201, 166, 107, 0.35) !important;
  box-shadow:
    0 30px 70px rgba(15, 20, 16, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
}

body.tb-front .rf-slide blockquote {
  font-size: clamp(1.4rem, 2.8vw, 1.9rem) !important;
  line-height: 1.4 !important;
}

/* —— Booking: dark luxury panel —— */
body.tb-front .booking-aside {
  position: relative;
  overflow: hidden;
}

body.tb-front .booking-aside::after {
  content: "";
  position: absolute;
  inset: auto -20% -30% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 166, 107, 0.2), transparent 70%);
  pointer-events: none;
}

body.tb-front .booking-form-panel {
  border-radius: 22px;
  box-shadow: 0 28px 60px rgba(15, 20, 16, 0.1);
}

body.tb-front .field input,
body.tb-front .field select,
body.tb-front .field textarea {
  border-radius: 12px !important;
  border: 1px solid rgba(15, 28, 22, 0.12) !important;
  background: #fffcf8 !important;
  transition: border-color 0.25s, box-shadow 0.3s, transform 0.25s !important;
}

body.tb-front .field input:focus,
body.tb-front .field select:focus,
body.tb-front .field textarea:focus {
  border-color: rgba(201, 166, 107, 0.65) !important;
  box-shadow: 0 0 0 4px rgba(201, 166, 107, 0.15) !important;
  outline: none;
}

/* —— Final CTA: stars —— */
body.tb-front .final-cta {
  min-height: 52vh;
  display: flex;
  align-items: center;
}

body.tb-front .final-cta-inner h2 {
  font-size: clamp(2.5rem, 5.5vw, 4rem) !important;
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

body.tb-front .final-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  align-items: center;
  margin-top: 0.5rem;
}

body.tb-front .final-cta .btn-ghost {
  color: #fffcf8 !important;
  border-color: rgba(240, 215, 176, 0.45) !important;
}

.sig-stars {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.sig-stars i {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(240, 215, 176, 0.85);
  box-shadow: 0 0 6px rgba(240, 215, 176, 0.6);
  animation: starTwinkle var(--d, 3s) ease-in-out infinite;
  opacity: 0.3;
}

@keyframes starTwinkle {
  0%,
  100% {
    opacity: 0.15;
    transform: scale(0.8);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.3);
  }
}

/* —— Host: editorial —— */
body.tb-front .host-card {
  border-radius: 24px !important;
  padding: 1.75rem !important;
  border: 1px solid rgba(201, 166, 107, 0.25) !important;
  background:
    linear-gradient(135deg, #fffcf8 0%, #f4ede2 100%) !important;
  box-shadow: 0 20px 50px rgba(15, 20, 16, 0.08) !important;
}

body.tb-front .host-photo {
  width: 104px !important;
  height: 104px !important;
  border: 3px solid rgba(201, 166, 107, 0.45);
}

/* —— Footer: deep —— */
body.tb-front .site-footer {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(201, 166, 107, 0.1), transparent 55%),
    linear-gradient(180deg, #0c1611, #070d0a) !important;
  border-top: 1px solid rgba(201, 166, 107, 0.12);
}

/* —— Scroll progress: thicker signature —— */
body.tb-front .scroll-progress {
  height: 3px !important;
  background: linear-gradient(
    90deg,
    #a8874f,
    #f0d7b0,
    #c9a66b,
    #f0d7b0,
    #a8874f
  ) !important;
  background-size: 300% 100% !important;
  box-shadow: 0 0 16px rgba(201, 166, 107, 0.65) !important;
}

/* —— Desk book bar: elevated —— */
body.tb-front .desk-book-bar-inner {
  background: rgba(8, 14, 11, 0.94) !important;
  border: 1px solid rgba(240, 215, 176, 0.35) !important;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(201, 166, 107, 0.1) inset !important;
}

/* —— Page loader: cinematic —— */
body.tb-front .page-loader {
  background:
    radial-gradient(ellipse at center, #1a2e24 0%, #0a100e 70%) !important;
}

body.tb-front .page-loader-mark {
  width: 56px !important;
  height: 56px !important;
  border-width: 1.5px !important;
  border-color: rgba(201, 166, 107, 0.15) !important;
  border-top-color: #f0d7b0 !important;
}

body.tb-front .page-loader p {
  letter-spacing: 0.28em !important;
  font-size: 0.95rem !important;
}

/* —— Text selection —— */
body.tb-front ::selection {
  background: rgba(201, 166, 107, 0.4);
  color: #0f1c16;
}

/* —— Image mask reveal DISABLED (was clipping photos off-screen) —— */
.sig-mask-reveal,
.sig-mask-reveal.is-shown {
  clip-path: none !important;
}

/* —— Floating gold dust (hero only, subtle) —— */
.sig-dust {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.sig-dust span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(240, 215, 176, 0.55);
  box-shadow: 0 0 8px rgba(240, 215, 176, 0.4);
  animation: dustFloat linear infinite;
  opacity: 0;
}

@keyframes dustFloat {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.5);
  }
  10% {
    opacity: 0.7;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: translateY(-70vh) scale(1);
  }
}

/* —— Pull quote cinema —— */
body.tb-front .pull-quote blockquote p {
  font-size: clamp(1.5rem, 3.2vw, 2.25rem) !important;
  line-height: 1.35 !important;
  font-weight: 400;
}

/* —— Location map frame —— */
body.tb-front .location-map {
  border-radius: 22px !important;
  box-shadow:
    0 28px 60px rgba(15, 20, 16, 0.14),
    0 0 0 1px rgba(201, 166, 107, 0.25) !important;
}

body.tb-front .location-map iframe {
  filter: grayscale(0.25) contrast(1.05) saturate(0.9);
  transition: filter 0.5s;
}

body.tb-front .location-map:hover iframe {
  filter: none;
}

/* —— Season cards —— */
body.tb-front .season-card {
  border-radius: 16px !important;
  overflow: hidden;
}

body.tb-front .season-card:hover {
  transform: translateY(-8px) !important;
}

/* —— FAQ —— */
body.tb-front .faq-item {
  border-radius: 14px !important;
  border: 1px solid var(--line);
  margin-bottom: 0.55rem;
  background: var(--paper);
  overflow: hidden;
}

body.tb-front .faq-q {
  width: 100%;
  text-align: left;
  padding: 1.1rem 1.25rem !important;
}

body.tb-front .faq-item.open {
  border-color: rgba(201, 166, 107, 0.4) !important;
  box-shadow: 0 16px 40px rgba(15, 20, 16, 0.08) !important;
}

/* —— Stay checklist elevate —— */
body.tb-front .stay-checklist-inner {
  border-radius: 28px !important;
  box-shadow:
    0 32px 70px rgba(15, 20, 16, 0.1),
    0 0 0 1px rgba(201, 166, 107, 0.2) !important;
}

/* —— Section rail signature —— */
body.tb-front .section-rail {
  background: rgba(15, 28, 22, 0.88) !important;
  border-color: rgba(201, 166, 107, 0.25) !important;
  padding: 0.75rem 0.5rem !important;
}

body.tb-front .section-rail a {
  background: rgba(255, 252, 248, 0.25) !important;
}

body.tb-front .section-rail a.active {
  background: var(--sig-gold) !important;
  box-shadow: 0 0 0 3px rgba(201, 166, 107, 0.35) !important;
}

body.tb-front .section-rail a[data-tip]::after {
  background: #0a100e !important;
  border: 1px solid rgba(201, 166, 107, 0.35);
  color: var(--sig-gold-bright) !important;
}

/* —— Lightbox signature —— */
body.tb-front .lightbox {
  background: rgba(5, 8, 7, 0.94) !important;
  backdrop-filter: blur(12px);
}

body.tb-front .lightbox img {
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  max-height: 72vh;
}

/* —— Magnetic press feel —— */
.sig-press {
  transition: transform 0.15s ease !important;
}

.sig-press:active {
  transform: scale(0.97) !important;
}

/* —— Horizontal marquee speed polish —— */
body.tb-front .atmosphere-track {
  animation-duration: 48s !important;
}

/* —— Reduced motion —— */
@media (prefers-reduced-motion: reduce) {
  .sig-cursor,
  .sig-cursor-dot,
  .sig-dust,
  .sig-stars,
  .hero-frame,
  body.tb-front .trust-bar::before {
    display: none !important;
    animation: none !important;
  }
  html.tb-signature.sig-cursor-on body.tb-front,
  html.tb-signature.sig-cursor-on body.tb-front * {
    cursor: auto !important;
  }
  body.tb-front.js-reveal .reveal:not(.visible) {
    opacity: 1;
    filter: none;
    transform: none;
    clip-path: none;
  }
}
