/* ==========================================================================
   EF Words Group — Editorial × Cinematic design system
   Tailwind (Play CDN) handles utilities; this layer adds the brand,
   colour, animation and interaction toolkit used across all pages.
   ========================================================================== */

:root {
  /* base — warm editorial */
  --sand:   #f4efe6;
  --cream:  #fbf8f2;
  --paper:  #fefcf8;
  --ink:    #211d18;
  --brown:  #473c38;
  --muted:  #6b6258;
  --line:   rgba(33, 29, 24, 0.12);

  /* expanded jewel palette for full-bleed sections */
  --accent:   #a67c42;  /* ochre/gold        */
  --gold:     #c79a5c;  /* lighter gold      */
  --forest:   #173b34;  /* deep teal-green   */
  --forest-2: #0f2d28;
  --navy:     #1b2a3a;  /* deep navy         */
  --plum:     #4d3142;  /* aubergine         */
  --terra:    #bf5a3c;  /* terracotta        */
  --terra-2:  #a64a30;
  --clay:     #d98b5f;
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--sand);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #fff; }

.font-display { font-family: 'Fraunces', Georgia, 'Times New Roman', serif; }

section[id], div[id].anchor, #contact-form { scroll-margin-top: 7rem; }

/* ---- Scroll progress bar ------------------------------------------------ */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--terra));
  z-index: 60; transition: width .08s linear;
}

/* ---- Eyebrow ----------------------------------------------------------- */
.eyebrow {
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  font-weight: 600; color: var(--accent);
}
.eyebrow--muted { color: var(--muted); }
.eyebrow--gold  { color: var(--gold); }

/* ---- Gradient / display text ------------------------------------------- */
.text-gradient {
  background: linear-gradient(100deg, var(--accent), var(--terra) 60%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.text-gradient-cool {
  background: linear-gradient(100deg, var(--gold), #e7c79a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem; position: relative;
  font-size: 0.92rem; font-weight: 500; letter-spacing: 0.01em;
  padding: 0.9rem 1.7rem; border-radius: 999px; overflow: hidden;
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease;
  will-change: transform;
}
.btn-primary { background: var(--ink); color: #fbf8f2; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -16px rgba(33,29,24,.6); }
.btn-primary::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(100deg, var(--terra), var(--accent));
  opacity: 0; transition: opacity .3s ease;
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary > * { position: relative; z-index: 1; }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-light { background: var(--cream); color: var(--ink); }
.btn-light:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -16px rgba(0,0,0,.5); }
.btn-outline-light { border: 1px solid rgba(255,255,255,.4); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.btn .arrow { transition: transform .3s ease; }
.btn:hover .arrow { transform: translateX(4px); }

/* ---- Animated text link ------------------------------------------------ */
.link-underline { position: relative; color: var(--ink); font-weight: 500; }
.link-underline::after {
  content: ""; position: absolute; left: 0; bottom: -3px; width: 100%; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.link-underline:hover::after { transform: scaleX(1); }

/* ---- Header ------------------------------------------------------------ */
.site-header { transition: background-color .4s ease, box-shadow .4s ease, border-color .4s ease; border-bottom: 1px solid transparent; }
.site-header.is-scrolled {
  background: rgba(244, 239, 230, 0.82);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom-color: var(--line);
}
.nav-link { position: relative; font-size: 0.9rem; color: var(--muted); transition: color .2s ease; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--ink); }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -6px; width: 100%; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.nav-link:hover::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); }

/* ---- Hairlines & cards ------------------------------------------------- */
.hairline { border-top: 1px solid var(--line); }
.card-line { border: 1px solid var(--line); transition: border-color .4s ease, transform .4s cubic-bezier(.2,.8,.2,1), box-shadow .4s ease; }
.card-line:hover { border-color: rgba(33,29,24,.28); transform: translateY(-4px); box-shadow: 0 24px 50px -32px rgba(33,29,24,.45); }

.index-num { font-feature-settings: "tnum"; color: var(--accent); }

/* ---- Tilt cards (JS adds rotation vars) -------------------------------- */
.tilt { transform-style: preserve-3d; transition: transform .25s cubic-bezier(.2,.8,.2,1); will-change: transform; }
.tilt-inner { transform: translateZ(28px); }

/* ---- Image frames / hover zoom ----------------------------------------- */
.img-zoom { overflow: hidden; }
.img-zoom img { transition: transform 1.1s cubic-bezier(.16,1,.3,1); will-change: transform; }
.img-zoom:hover img { transform: scale(1.06); }

.media-frame { position: relative; overflow: hidden; border-radius: 4px; }
.media-frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

/* duotone-ish warm overlay for cohesion across stock photos */
.warm-overlay { position: relative; }
.warm-overlay::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(18,15,12,.66), rgba(28,24,20,.6) 50%, rgba(18,15,12,.78));
}
/* dim bright hero photos a touch so overlaid text always reads */
.warm-overlay .parallax, .warm-overlay > .absolute img { filter: brightness(.82) saturate(1.05); }
.warm-overlay > * { position: relative; z-index: 2; }
.warm-overlay > .absolute { z-index: 0; }  /* keep bg-image wrapper behind the ::before overlay */

/* ---- Parallax ---------------------------------------------------------- */
.parallax { will-change: transform; }

/* ---- Marquee ----------------------------------------------------------- */
.marquee { display: flex; overflow: hidden; user-select: none; gap: 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; flex-shrink: 0; align-items: center; gap: 3.5rem; padding-right: 3.5rem; animation: marquee 32s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee--rev .marquee__track { animation-direction: reverse; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---- Spotlight (cursor glow) ------------------------------------------- */
.spotlight { position: relative; isolation: isolate; }
.spotlight::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0;
  transition: opacity .4s ease;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(199,154,92,.18), transparent 60%);
}
.spotlight:hover::before { opacity: 1; }

/* ---- Animated mesh gradient backdrop ----------------------------------- */
.mesh { position: absolute; inset: -20% -10%; z-index: 0; filter: blur(60px); opacity: .5; pointer-events: none; }
.mesh span { position: absolute; width: 46%; height: 46%; border-radius: 50%; animation: float 16s ease-in-out infinite; }
.mesh .b1 { background: var(--gold);  top: 4%;  left: 6%;  }
.mesh .b2 { background: var(--terra); top: 30%; right: 4%; animation-delay: -4s; }
.mesh .b3 { background: var(--forest);bottom: 0; left: 28%; animation-delay: -8s; opacity:.6; }
@keyframes float {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(6%,-8%) scale(1.08); }
  66%     { transform: translate(-5%,6%) scale(.95); }
}
.float-slow { animation: float 18s ease-in-out infinite; }

/* ---- Count-up figures -------------------------------------------------- */
.stat-num { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

/* ---- Scroll reveal (class + data-reveal variants) ---------------------- */
.reveal, [data-reveal] {
  opacity: 0; transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1), clip-path .9s cubic-bezier(.16,1,.3,1);
}
.reveal { transform: translateY(26px); }
[data-reveal="up"]    { transform: translateY(40px); }
[data-reveal="left"]  { transform: translateX(-44px); }
[data-reveal="right"] { transform: translateX(44px); }
[data-reveal="scale"] { transform: scale(.92); }
[data-reveal="clip"]  { clip-path: inset(0 0 100% 0); opacity: 1; }
.reveal.in-view, [data-reveal].in-view { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }

.reveal[data-delay="1"], [data-reveal][data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"], [data-reveal][data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"], [data-reveal][data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"], [data-reveal][data-delay="4"] { transition-delay: .32s; }
.reveal[data-delay="5"], [data-reveal][data-delay="5"] { transition-delay: .40s; }

/* word-by-word headline reveal */
.word { display: inline-block; opacity: 0; transform: translateY(45%); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.in-view .word:nth-child(2) { transition-delay: .06s; }
.in-view .word:nth-child(3) { transition-delay: .12s; }
.in-view .word:nth-child(4) { transition-delay: .18s; }
.in-view .word:nth-child(5) { transition-delay: .24s; }
.in-view .word:nth-child(6) { transition-delay: .30s; }
.in-view .word { opacity: 1; transform: none; }

/* ---- Forms ------------------------------------------------------------- */
.field {
  width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 4px;
  padding: 0.9rem 1rem; font-size: 0.95rem; color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(166,124,66,.14); }
.field::placeholder { color: #a89e90; }

/* ---- Mobile menu ------------------------------------------------------- */
.mobile-menu { max-height: 0; overflow: hidden; transition: max-height .45s ease; }
.mobile-menu.open { max-height: 520px; }

/* ---- Decorative ------------------------------------------------------- */
.rule-accent { width: 56px; height: 2px; background: var(--accent); }
.badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.section-watermark { font-family: 'Fraunces', serif; position: absolute; font-size: 22vw; line-height: 1; color: rgba(33,29,24,.035); top: -.1em; right: -.02em; pointer-events: none; user-select: none; z-index: 0; }

/* drag cursor for horizontal scroller */
.hscroll { cursor: grab; }
.hscroll.dragging { cursor: grabbing; }
.hscroll::-webkit-scrollbar { height: 0; }

/* ---- Reduced motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, [data-reveal], .word { opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important; }
  .mesh span, .float-slow, .marquee__track { animation: none !important; }
}
