/* ════════════════════════════════════════════════════════════════
   Marjoram — craft layer: motion, texture, easing
   The difference between "blocky template" and "premium" is almost
   all here: entrance animation, scroll reveals, a living background,
   film grain, and slow cubic-bezier easing everywhere.
   ════════════════════════════════════════════════════════════════ */

:root {
  /* one easing curve used everywhere for a consistent, expensive feel */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Product spec lists (Form / MOQ / Shelf life / Origin) are HIDDEN for now —
   these commercial terms are discussed directly with the customer, not shown
   publicly. Markup + data are kept (locales) so they can be switched back on
   later by deleting this one rule. Only `<dl>` on the site is the product specs. */
section dl { display: none; }

html { scroll-behavior: smooth; }

:focus-visible { outline: 2px solid #b35138; outline-offset: 2px; }

img { background-color: rgba(237, 227, 209, 0.4); }

/* ─── FILM GRAIN OVERLAY ───────────────────────────────────────────
   Fixed, full-screen, very subtle. This single touch makes flat color
   areas feel like printed paper instead of digital blocks. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ─── LIVING HERO GRADIENT ─────────────────────────────────────────
   Shown behind the hero when there's no video/photo yet. A slow drifting
   warm mesh — earth, spice, cacao — so the hero is never a dead block. */
.living-gradient {
  background:
    radial-gradient(60% 80% at 20% 20%, #3a2418 0%, transparent 60%),
    radial-gradient(50% 70% at 80% 30%, #2d4a2a 0%, transparent 55%),
    radial-gradient(70% 90% at 60% 90%, #b35138 0%, transparent 55%),
    linear-gradient(135deg, #1f1a17, #2d2018);
  background-size: 200% 200%, 200% 200%, 200% 200%, 100% 100%;
  animation: drift 24s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { background-position:   0% 0%,   100% 0%,  50% 100%, 0 0; }
  50%  { background-position:  40% 60%,  60% 30%,  20% 50%,  0 0; }
  100% { background-position: 100% 100%,  0% 80%,  80% 0%,   0 0; }
}

/* ─── HERO ENTRANCE (on page load) ─────────────────────────────────
   Lines fade up, staggered. The single most "crafted"-feeling detail. */
.hero-line {
  opacity: 0;
  transform: translateY(40px);
  animation: heroIn 1.4s var(--ease) forwards;
}
.hero-line:nth-child(1) { animation-delay: 0.15s; }
.hero-line:nth-child(2) { animation-delay: 0.30s; }
.hero-line:nth-child(3) { animation-delay: 0.45s; }
.hero-up    { opacity: 0; transform: translateY(24px); animation: heroIn 1.2s var(--ease) 0.7s forwards; }
.hero-up-2  { opacity: 0; transform: translateY(24px); animation: heroIn 1.2s var(--ease) 0.9s forwards; }
.hero-fade  { opacity: 0; animation: fadeOnly 1.6s var(--ease) 0.2s forwards; }
@keyframes heroIn   { to { opacity: 1; transform: none; } }
@keyframes fadeOnly { to { opacity: 1; } }

/* ─── SCROLL REVEALS ───────────────────────────────────────────────
   Elements with .reveal start hidden and animate in when scrolled into
   view (toggled by reveal.js adding .in-view). Stagger via --d. */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.in-view { opacity: 1; transform: none; }

/* line-by-line clip reveal for big headings */
.reveal-mask { overflow: hidden; }
.reveal-mask > * {
  transform: translateY(110%);
  transition: transform 1.1s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal-mask.in-view > * { transform: none; }

/* ─── IMAGE HOVER ZOOM ─────────────────────────────────────────────*/
.img-zoom { overflow: hidden; }
.img-zoom img {
  transition: transform 1.4s var(--ease);
  will-change: transform;
}
.img-zoom:hover img { transform: scale(1.06); }

/* ─── ANIMATED LINK UNDERLINE ──────────────────────────────────────*/
.link-line { position: relative; }
.link-line::after {
  content: ""; position: absolute; left: 0; bottom: -3px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.link-line:hover::after { transform: scaleX(1); transform-origin: left; }

/* ─── MARQUEE ──────────────────────────────────────────────────────*/
.marquee { animation: marquee 32s linear infinite; will-change: transform; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee:hover { animation-play-state: paused; }

#lang-switch option { background: #faf6ef; color: #1f1a17; }

/* ─── FARM-FIELD BACKGROUND for light sections ─────────────────────
   Shows photos/field.jpg faintly behind text with a cream wash so the
   dark text stays readable. If field.jpg is missing, the cream gradient
   renders as a near-solid warm tone — graceful fallback, never broken. */
.field-bg {
  background-color: #ede3d1;
  background-image:
    linear-gradient(rgba(250,246,239,0.80), rgba(250,246,239,0.88)),
    url("../photos/field.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;   /* subtle parallax as you scroll */
}
/* On touch devices, fixed attachment is janky — switch to scroll */
@media (hover: none) {
  .field-bg { background-attachment: scroll; }
}

/* ─── RESPECT REDUCED MOTION ───────────────────────────────────────*/
@media (prefers-reduced-motion: reduce) {
  .marquee, .living-gradient { animation: none; }
  .hero-line, .hero-up, .hero-up-2, .hero-fade,
  .reveal, .reveal-mask > * { animation: none; transition: none; opacity: 1; transform: none; }
}
