/* ==========================================================================
   Grove Core Lab — shared stylesheet
   Japanese nature × material design studio
   ========================================================================== */

:root{
  --forest:#1F3A2E;
  --forest-light:#2F4E3C;
  --moss:#6B7A54;
  --moss-light:#8A9770;
  --cedar:#8B5E3C;
  --cedar-light:#A97C55;
  --beige:#EDE6D6;
  --cream:#FBF8F2;
  --ink:#2B2B26;
  --line: rgba(43,43,38,.12);
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  background:var(--cream);
  color:var(--ink);
  font-family:'Shippori Mincho', serif;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}
.font-en{ font-family:'Marcellus', serif; letter-spacing:.03em; }
.font-jp{ font-family:'Shippori Mincho', serif; }

/* subtle grain overlay for premium editorial feel */
body::before{
  content:'';
  position:fixed; inset:0; z-index:9999; pointer-events:none;
  opacity:.035; mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Selection ---------- */
::selection{ background:var(--moss); color:var(--cream); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar{ width:10px; }
::-webkit-scrollbar-track{ background:var(--beige); }
::-webkit-scrollbar-thumb{ background:var(--moss); border-radius:10px; }

/* ---------- Sticky Nav ---------- */
#site-nav{
  position:fixed; top:0; left:0; right:0; z-index:1000;
  backdrop-filter:blur(10px);
  background:rgba(251,248,242,.72);
  border-bottom:1px solid transparent;
  transition:all .45s ease;
}
#site-nav.scrolled{
  background:rgba(251,248,242,.94);
  border-bottom-color:var(--line);
  box-shadow:0 8px 30px -20px rgba(31,58,46,.35);
}
#site-nav .nav-link{
  position:relative; color:var(--forest); opacity:.75;
  transition:opacity .3s ease;
}
#site-nav .nav-link:hover, #site-nav .nav-link.active{ opacity:1; }
#site-nav .nav-link::after{
  content:''; position:absolute; left:0; bottom:-6px; height:1px; width:0;
  background:var(--cedar); transition:width .35s ease;
}
#site-nav .nav-link:hover::after, #site-nav .nav-link.active::after{ width:100%; }

/* mobile menu */
#mobile-menu{
  max-height:0; overflow:hidden; transition:max-height .5s ease;
}
#mobile-menu.open{ max-height:600px; }

/* ---------- Logo mark ---------- */
.logo-mark{ width:42px; height:42px; flex:0 0 auto; }
.logo-ring{ transform-origin:center; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:.6rem;
  padding:.9rem 2rem; border-radius:999px;
  font-family:'Marcellus', serif; letter-spacing:.08em; font-size:.85rem;
  text-transform:uppercase; transition:all .4s cubic-bezier(.22,1,.36,1);
  border:1px solid currentColor;
}
.btn-fill{ background:var(--forest); color:var(--cream); border-color:var(--forest); }
.btn-fill:hover{ background:var(--cedar); border-color:var(--cedar); transform:translateY(-2px); box-shadow:0 12px 24px -10px rgba(139,94,60,.5); }
.btn-outline{ color:var(--cream); border-color:rgba(251,248,242,.6); }
.btn-outline:hover{ background:rgba(251,248,242,.12); border-color:var(--cream); transform:translateY(-2px); }
.btn-outline-dark{ color:var(--forest); border-color:var(--forest); }
.btn-outline-dark:hover{ background:var(--forest); color:var(--cream); transform:translateY(-2px); }

/* ---------- Reveal on scroll ---------- */
.reveal{ opacity:0; transform:translateY(28px); transition:opacity .9s cubic-bezier(.22,1,.36,1), transform .9s cubic-bezier(.22,1,.36,1); }
.reveal.in{ opacity:1; transform:translateY(0); }
.reveal-l{ opacity:0; transform:translateX(-32px); transition:opacity .9s ease, transform .9s cubic-bezier(.22,1,.36,1); }
.reveal-l.in{ opacity:1; transform:translateX(0); }
.reveal-r{ opacity:0; transform:translateX(32px); transition:opacity .9s ease, transform .9s cubic-bezier(.22,1,.36,1); }
.reveal-r.in{ opacity:1; transform:translateX(0); }
.reveal-scale{ opacity:0; transform:scale(.92); transition:opacity 1s ease, transform 1s cubic-bezier(.22,1,.36,1); }
.reveal-scale.in{ opacity:1; transform:scale(1); }
.delay-1{ transition-delay:.12s; } .delay-2{ transition-delay:.24s; } .delay-3{ transition-delay:.36s; } .delay-4{ transition-delay:.48s; }

/* ---------- Hero ---------- */
.hero{ position:relative; min-height:100svh; overflow:hidden; }
.hero-bg{
  position:absolute; inset:0; background-size:cover; background-position:center;
  transform:scale(1.08);
}
.hero-veil{
  position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(15,26,20,.55) 0%, rgba(15,26,20,.35) 40%, rgba(15,26,20,.75) 100%);
}
.parallax{ will-change:transform; }

/* Page hero (interior pages, shorter) */
.page-hero{ position:relative; min-height:56vh; overflow:hidden; }

/* ---------- Floating leaves ---------- */
.leaves-container{ position:absolute; inset:0; overflow:hidden; pointer-events:none; z-index:5; }
.leaf{
  position:absolute; top:-10%; opacity:.75; will-change:transform;
  animation-name:leafFall; animation-timing-function:linear; animation-iteration-count:infinite;
}
@keyframes leafFall{
  0%{ transform:translate(0,0) rotate(0deg); opacity:0; }
  8%{ opacity:.8; }
  92%{ opacity:.6; }
  100%{ transform:translate(var(--drift,60px), 115vh) rotate(360deg); opacity:0; }
}

/* ---------- Tree ring animation ---------- */
.ring-draw{ stroke-dasharray:600; stroke-dashoffset:600; animation:ringDraw 2.6s cubic-bezier(.22,1,.36,1) forwards; }
.ring-draw.d2{ animation-delay:.25s; }
.ring-draw.d3{ animation-delay:.5s; }
.ring-draw.d4{ animation-delay:.75s; }
@keyframes ringDraw{ to{ stroke-dashoffset:0; } }
.ring-spin{ animation:ringSpin 60s linear infinite; transform-origin:center; }
.ring-spin-rev{ animation:ringSpinRev 80s linear infinite; transform-origin:center; }
@keyframes ringSpin{ to{ transform:rotate(360deg); } }
@keyframes ringSpinRev{ to{ transform:rotate(-360deg); } }

/* ---------- Editorial texture panels ---------- */
.texture-panel{
  position:relative; border-radius:2px; overflow:hidden;
  background-size:cover; background-position:center;
}
.texture-panel::after{
  content:''; position:absolute; inset:0;
  background:linear-gradient(180deg, transparent 55%, rgba(31,58,46,.55) 100%);
  opacity:0; transition:opacity .5s ease;
}
.texture-panel:hover::after{ opacity:1; }
.texture-panel img{ transition:transform 1.1s cubic-bezier(.22,1,.36,1); }
.texture-panel:hover img{ transform:scale(1.06); }

/* ---------- Editorial project cards ---------- */
.proj-card{
  position:relative; overflow:hidden; border-radius:2px;
  background:var(--beige);
}
.proj-card .proj-img{ overflow:hidden; }
.proj-card .proj-img img{ transition:transform 1s cubic-bezier(.22,1,.36,1), filter .6s ease; }
.proj-card:hover .proj-img img{ transform:scale(1.08); }
.proj-card .proj-num{ font-family:'Marcellus', serif; }

/* ---------- Masonry gallery ---------- */
.masonry{ column-gap:1rem; }
.masonry .m-item{ break-inside:avoid; margin-bottom:1rem; position:relative; overflow:hidden; border-radius:2px; }
.masonry .m-item img{ width:100%; display:block; transition:transform .9s cubic-bezier(.22,1,.36,1); }
.masonry .m-item:hover img{ transform:scale(1.07); }
.masonry .m-item .m-caption{
  position:absolute; inset:auto 0 0 0; padding:1rem;
  background:linear-gradient(0deg, rgba(15,26,20,.82), transparent);
  color:#fff; opacity:0; transform:translateY(10px);
  transition:all .4s ease;
}
.masonry .m-item:hover .m-caption{ opacity:1; transform:translateY(0); }

/* ---------- Divider ---------- */
.divider-ring{ width:56px; height:56px; }

/* ---------- Forms ---------- */
.field{
  width:100%; background:transparent; border:none; border-bottom:1px solid var(--line);
  padding:.85rem .2rem; font-family:'Shippori Mincho',serif; color:var(--ink); outline:none;
  transition:border-color .3s ease;
}
.field:focus{ border-color:var(--cedar); }
.field::placeholder{ color:rgba(43,43,38,.4); }

/* ---------- Toast (non-blocking popup, replaces alert) ---------- */
#toast-root{ position:fixed; top:1.25rem; right:1.25rem; z-index:99999; display:flex; flex-direction:column; gap:.6rem; pointer-events:none; }
.toast{
  pointer-events:auto;
  min-width:260px; max-width:340px;
  background:var(--forest); color:var(--cream);
  border-left:3px solid var(--cedar-light);
  padding:1rem 1.2rem; border-radius:4px;
  box-shadow:0 20px 40px -15px rgba(15,26,20,.5);
  font-family:'Marcellus', serif; font-size:.85rem; letter-spacing:.02em;
  transform:translateX(120%); opacity:0; transition:all .5s cubic-bezier(.22,1,.36,1);
}
.toast.show{ transform:translateX(0); opacity:1; }
.toast .toast-title{ font-size:.7rem; text-transform:uppercase; letter-spacing:.15em; color:var(--cedar-light); margin-bottom:.3rem; }

/* ---------- FAQ accordion ---------- */
.faq-item .faq-a{ max-height:0; overflow:hidden; transition:max-height .5s ease; }
.faq-item.open .faq-a{ max-height:400px; }
.faq-item .faq-plus{ transition:transform .4s ease; }
.faq-item.open .faq-plus{ transform:rotate(135deg); }

/* ---------- Back to top ---------- */
#backtotop{
  position:fixed; right:1.25rem; bottom:1.25rem; z-index:400;
  width:48px; height:48px; border-radius:50%;
  background:var(--forest); color:var(--cream);
  display:flex; align-items:center; justify-content:center;
  opacity:0; pointer-events:none; transform:translateY(10px);
  transition:all .4s ease;
}
#backtotop.show{ opacity:1; pointer-events:auto; transform:translateY(0); }
#backtotop:hover{ background:var(--cedar); }

/* ---------- Misc utilities ---------- */
.bg-noise-forest{ background:radial-gradient(120% 120% at 20% 0%, var(--forest-light) 0%, var(--forest) 60%, #142720 100%); }
.text-outline{ -webkit-text-stroke:1px currentColor; color:transparent; }
.eyebrow{ font-family:'Marcellus',serif; letter-spacing:.32em; text-transform:uppercase; font-size:.72rem; }

@media (max-width: 767px){
  .masonry{ column-count:1 !important; }
}
@media (min-width: 768px) and (max-width: 1023px){
  .masonry{ column-count:2 !important; }
}
@media (min-width: 1024px){
  .masonry{ column-count:3; }
}

img{ max-width:100%; height:auto; }
