/* =========================================================
   පැළේ – Ceylon Agri Partner
   Design tokens first: keep these when moving to a store
   platform (Shopify / WooCommerce theme settings map 1:1).
   ========================================================= */
:root {
  --mango: #F7C400;
  --leaf: #7AC52E;
  --deep: #0E2814;
  --ink: #10100C;
  --cream: #FFF9E8;

  --deep-2: #163a1e;          /* slightly lighter deep green for cards on dark */
  --cream-2: #f3ead0;         /* card borders on cream */

  --font-si: "Noto Sans Sinhala", "Iskoola Pota", sans-serif;
  --font-si-head: "Noto Sans Sinhala", "Iskoola Pota", sans-serif;  /* not Gemunu Libre: it drops the ෝ mark */
  --font-en: "Poppins", system-ui, sans-serif;

  --radius: 18px;
  --gutter: 16px;
  --max: 1120px;
  --focus: 0 0 0 3px var(--deep), 0 0 0 6px var(--mango);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-si);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--deep);
  -webkit-font-smoothing: antialiased;
}
[lang="en"] { font-family: var(--font-en); }
img, svg, video { display: block; max-width: 100%; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2 { text-wrap: balance; }
a { color: inherit; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 10px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.nowrap { white-space: nowrap; }

.skip-link {
  position: absolute; left: var(--gutter); top: -60px; z-index: 100;
  background: var(--mango); color: var(--ink); padding: 10px 16px; border-radius: 10px;
  font-family: var(--font-en); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.tagline {
  font-family: var(--font-si-head);
  font-weight: 700;
  color: var(--mango);
  font-size: 1.25rem;
  letter-spacing: .01em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 52px; padding: 12px 28px;
  border-radius: 999px; border: 2px solid var(--ink);
  font-family: var(--font-si); font-weight: 700; font-size: 1.05rem;
  text-decoration: none; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn--primary {
  background: var(--mango); color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.btn--primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) var(--gutter) 0;
}
.brand img { width: 84px; height: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }

.social-mini {
  display: flex; gap: 6px; margin-top: 8px;
  background: rgba(14, 40, 20, .55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  padding: 6px; border-radius: 999px;
}
.social-mini a {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  color: var(--cream); transition: background-color .2s, color .2s;
}
.social-mini a:hover { background: var(--mango); color: var(--ink); }
.social-mini svg { width: 18px; height: 18px; }

/* ---------- 1. Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  overflow: hidden; isolation: isolate;
  background: var(--deep) url("assets/hero-poster-mobile.jpg") center / cover no-repeat;
  padding: 0 var(--gutter) calc(88px + env(safe-area-inset-bottom));
  text-align: center;
}
@media (min-width: 768px), (orientation: landscape) {
  .hero { background-image: url("assets/hero-poster.jpg"); }
}
.hero__video {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .8s ease;
}
.hero__video.is-playing { opacity: 1; }
.hero__overlay {
  position: absolute; inset: auto 0 0 0; height: 70%; z-index: -1;
  background: linear-gradient(to top,
    rgba(14,40,20,.96) 0%, rgba(14,40,20,.82) 30%, rgba(14,40,20,.45) 62%, rgba(14,40,20,0) 100%);
  pointer-events: none;
}
.hero__content { max-width: 100%; display: grid; justify-items: center; gap: 14px; }
.hero__title {
  font-family: var(--font-si-head); font-weight: 800;
  color: var(--cream);
  /* one line at every width: the phrase is ~13.8× the font size wide */
  font-size: clamp(1.4rem, calc(7vw - 2px), 4.75rem);
  line-height: 1.3;
  white-space: nowrap;
  text-shadow: 0 2px 18px rgba(0,0,0,.35);
}
.hero__content { gap: 22px; }
.hero .btn { margin-top: 4px; }

.scroll-cue {
  position: absolute; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom));
  translate: -50% 0;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  color: var(--cream);
  animation: bob 1.8s ease-in-out infinite;
}
.scroll-cue svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
@keyframes bob { 0%,100% { transform: translateY(0); opacity: .7; } 50% { transform: translateY(8px); opacity: 1; } }

/* ---------- 2. Teaser ---------- */
.teaser { background: var(--cream); padding: 72px 0 80px; text-align: center; }
.eyebrow {
  display: inline-block; margin-bottom: 12px;
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: #3d7a12;
}
.teaser__title {
  font-family: var(--font-si-head); font-weight: 800;
  font-size: clamp(1.75rem, 7vw, 2.9rem); line-height: 1.35;
  color: var(--deep);
  max-width: 820px; margin: 0 auto;
}
.teaser__sub {
  max-width: 34em; margin: 12px auto 40px;
  font-size: clamp(1rem, 3.8vw, 1.2rem); color: #33452f;
}

/* Sealed mystery cards */
.mystery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 760px; margin: 0 auto; }
.mystery__card {
  position: relative; aspect-ratio: 3 / 4;
  display: grid; place-items: center;
  border-radius: var(--radius); overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, #1d4a26 0%, var(--deep) 75%);
  border: 1.5px solid rgba(14,40,20,.25);
  box-shadow: 0 10px 30px -14px rgba(14,40,20,.55);
}
/* blurred "something inside" glow */
.mystery__card::before {
  content: ""; position: absolute; inset: 18% 14%; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(122,197,46,.85), rgba(247,196,0,.35) 45%, transparent 70%);
  filter: blur(22px);
  animation: glow 3.6s ease-in-out infinite;
}
.mystery__card:nth-child(2)::before { animation-delay: -1.2s; }
.mystery__card:nth-child(3)::before { animation-delay: -2.4s; }
/* frosted veil */
.mystery__card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: repeating-linear-gradient(135deg, rgba(255,249,232,.05) 0 2px, transparent 2px 9px);
}
.mystery__q {
  font-family: var(--font-en); font-weight: 800; line-height: 1;
  font-size: clamp(2.6rem, 12vw, 4.5rem);
  color: var(--mango);
  text-shadow: 0 0 24px rgba(247,196,0,.55);
}
@keyframes glow { 0%,100% { opacity: .55; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.08); } }

.badge {
  position: absolute; top: 10px; left: 50%; translate: -50% 0;
  background: var(--mango); color: var(--ink); border: 1.5px solid var(--ink);
  font-size: .72rem; font-weight: 700; line-height: 1; padding: 6px 10px 5px; border-radius: 999px;
  white-space: nowrap;
}
.teaser__hint {
  display: inline-block; margin-top: 36px;
  font-weight: 700; font-size: 1.1rem; color: var(--deep); text-decoration: none;
  border-bottom: 2px solid var(--leaf); padding-bottom: 2px;
}
.teaser__hint:hover { color: #3d7a12; }

@media (min-width: 768px) {
  .mystery { gap: 22px; }
  .badge { top: 14px; font-size: .8rem; }
}

/* ---------- 3. Follow ---------- */
.follow {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(122,197,46,.16), transparent 60%),
    var(--deep);
  color: var(--cream);
  padding: 80px 0 88px; text-align: center;
}
.follow:focus { outline: none; }
.follow__title {
  font-family: var(--font-si-head); font-weight: 800;
  font-size: clamp(1.8rem, 7vw, 3rem); line-height: 1.25; color: var(--cream);
}
.follow .tagline { margin-top: 14px; }
.social-big { display: grid; gap: 12px; max-width: 520px; margin: 36px auto 0; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 60px; padding: 14px 24px; border-radius: 16px;
  font-weight: 600; font-size: 1.1rem; text-decoration: none;
  background: var(--deep-2); color: var(--cream);
  border: 2px solid rgba(255,249,232,.14);
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.social-btn svg { width: 26px; height: 26px; flex: none; }
.social-btn:hover { transform: translateY(-2px); background: var(--mango); color: var(--ink); border-color: var(--ink); }
.social-btn--facebook svg { color: #4a90ff; }
.social-btn--instagram svg { color: #ff6fa8; }
.social-btn--tiktok svg { color: #6fe7e0; }
.social-btn--youtube svg { color: #ff4d4d; }
.social-btn:hover svg { color: var(--ink); }

@media (min-width: 768px) {
  .social-big { grid-template-columns: repeat(2, 1fr); max-width: 680px; gap: 16px; }
}

.embed { margin: 48px auto 0; max-width: 360px; border-radius: var(--radius); overflow: hidden; border: 2px solid rgba(255,249,232,.14); }
.embed iframe { display: block; width: 100%; aspect-ratio: 9 / 16; border: 0; }

/* ---------- 4. Footer ---------- */
.site-footer { background: #0a1f0f; color: var(--cream); padding: 48px 0 calc(40px + env(safe-area-inset-bottom)); text-align: center; }
.footer__inner { display: grid; justify-items: center; gap: 12px; }
.footer__inner img { width: 88px; height: auto; }
.copyright { font-size: .85rem; opacity: .7; }
.copyright a { color: inherit; }

/* ---------- Cookie notice ---------- */
.cookie {
  position: fixed; z-index: 50;
  left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 14px;
  max-width: 640px; margin: 0 auto;
  padding: 12px 14px 12px 18px; border-radius: 16px;
  background: rgba(10,31,15,.96); color: var(--cream);
  border: 1px solid rgba(255,249,232,.15);
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.5);
  font-size: .85rem; line-height: 1.45;
}
.cookie p { display: grid; gap: 2px; flex: 1; min-width: 0; }
.cookie [lang="en"] { opacity: .75; font-size: .78rem; }
.cookie a { color: var(--mango); }
@media (max-width: 479px) {
  .cookie { font-size: .78rem; gap: 10px; padding: 10px 10px 10px 14px; }
  .cookie [lang="en"] { font-size: .72rem; }
}
/* ---------- Music toggle ---------- */
.sound {
  position: fixed; z-index: 40;
  right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--mango); color: var(--ink); border: 2px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink), 0 10px 24px -8px rgba(0,0,0,.45);
}
.sound svg { width: 26px; height: 26px; fill: currentColor; stroke: currentColor; stroke-width: 0; }
.sound .wave, .sound__off path + path { fill: none; stroke-width: 2; stroke-linecap: round; }
.sound__on { display: none; }
.sound.is-on .sound__on { display: block; }
.sound.is-on .sound__off { display: none; }
.sound.is-on::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid var(--mango); animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse { from { opacity: .8; transform: scale(.9); } to { opacity: 0; transform: scale(1.3); } }
/* keep it clear of the cookie notice while that is showing */
.cookie:not([hidden]) ~ .sound { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 96px); }

.btn--sm { min-height: 42px; padding: 8px 20px; font-size: .95rem; flex: none; }

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
  :root { --gutter: 32px; }
  .brand img { width: 120px; }
  .social-mini { margin-top: 14px; }
  .hero { padding-bottom: 110px; }
}

/* ---------- Scroll fade-up (only when JS is on) ---------- */
.js .fade-up { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .fade-up.is-visible { opacity: 1; transform: none; }
.js .mystery .fade-up { transform: translateY(40px) scale(.96); transition-duration: 1.1s; }
.js .mystery .fade-up.is-visible { transform: none; }
.js .mystery .fade-up:nth-child(2) { transition-delay: .18s; }
.js .mystery .fade-up:nth-child(3) { transition-delay: .36s; }
.js .social-big .fade-up:nth-child(2) { transition-delay: .08s; }
.js .social-big .fade-up:nth-child(3) { transition-delay: .16s; }
.js .social-big .fade-up:nth-child(4) { transition-delay: .24s; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .fade-up, .js .mystery .fade-up { opacity: 1; transform: none; }
  .hero__video { display: none; }
}
