/* ================================================================
   PRIME CHARTERS — "MERIDIAN" DESIGN SYSTEM (v2 — light theme)
   assets/css/theme.css
   ================================================================ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ── Hard overflow guard (fixes the "screen overflowing" bug) ──── */
html, body { max-width: 100%; overflow-x: hidden; }
body { background: #F7F5F0; color: #0B0E14; font-family: 'Inter', sans-serif; }
section, header, footer, div { max-width: 100vw; }
img, video { max-width: 100%; height: auto; }

h1,h2,h3,h4,h5,h6, .font-display { font-family: 'Space Grotesk', sans-serif; }
.font-mono-data { font-family: 'JetBrains Mono', monospace; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #F7F5F0; }
::-webkit-scrollbar-thumb { background: #FF5A1F; border-radius: 99px; }
::selection { background: #FF5A1F; color: #fff; }

/* ── Preloader (light, short-lived, DOMContentLoaded-based) ─────── */
#preloader {
  position: fixed; inset: 0; z-index: 100000;
  background: #F7F5F0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  transition: opacity .5s ease, visibility .5s ease;
}
#preloader.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.pre-mark {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, #FF5A1F, #FFB088);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.3rem; color: #fff;
  animation: preSpin 1.1s cubic-bezier(.6,0,.4,1) infinite;
}
@keyframes preSpin {
  0%   { transform: scale(1) rotate(0deg); border-radius: 14px; }
  50%  { transform: scale(.85) rotate(180deg); border-radius: 50%; }
  100% { transform: scale(1) rotate(360deg); border-radius: 14px; }
}
.pre-bar { width: 140px; height: 3px; background: rgba(11,14,20,.08); border-radius: 99px; overflow: hidden; }
.pre-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg,#FF5A1F,#A3E635); animation: preFill .9s ease forwards; }
@keyframes preFill { to { width: 100%; } }

/* ── Glass surfaces (light) ──────────────────────────────────── */
.glass { background: rgba(255,255,255,.75); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); }
.glass-dark { background: rgba(11,14,20,.7); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }

/* ── Blob motion — ALWAYS pair with an overflow-hidden ancestor ── */
@keyframes blobMove {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(30px,-40px) scale(1.1); }
  66%     { transform: translate(-25px,25px) scale(.92); }
}
.blob { animation: blobMove 14s ease-in-out infinite; filter: blur(50px); }

/* ── Marquee ──────────────────────────────────────────────────── */
.marquee-track { display: flex; width: max-content; animation: marqueeScroll 32s linear infinite; }
.marquee-track:hover { animation-play-state: paused; }
@keyframes marqueeScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.noise::before {
  content:''; position:absolute; inset:0; pointer-events:none; opacity:.02; z-index:1;
  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");
}

.text-gradient { background: linear-gradient(90deg,#FF5A1F,#C43E0F 45%,#65A30D); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }

/* ── Scroll reveal ────────────────────────────────────────────── */
.pc-reveal { opacity:0; transform:translateY(28px); transition:opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); }
.pc-reveal.visible { opacity:1; transform:translateY(0); }
.pc-reveal.dir-left { transform:translateX(-40px); }
.pc-reveal.dir-left.visible { transform:translateX(0); }
.pc-reveal.dir-right { transform:translateX(40px); }
.pc-reveal.dir-right.visible { transform:translateX(0); }
.pc-reveal.dir-scale { transform:scale(.92); }
.pc-reveal.dir-scale.visible { transform:scale(1); }
.pc-reveal-delay-1{transition-delay:.08s;} .pc-reveal-delay-2{transition-delay:.16s;}
.pc-reveal-delay-3{transition-delay:.24s;} .pc-reveal-delay-4{transition-delay:.32s;}
.pc-reveal-delay-5{transition-delay:.4s;}  .pc-reveal-delay-6{transition-delay:.48s;}
/* Safety net: if JS never runs for any reason, content must still be visible after 2.5s */
@keyframes forceReveal { to { opacity:1; transform:none; } }
.pc-reveal { animation: forceReveal 0s 2.5s forwards; }

.pc-magnetic { transition: transform .25s cubic-bezier(.34,1.56,.64,1); will-change:transform; }
.pc-ripple { position:relative; overflow:hidden; }
.pc-ripple-circle { position:absolute; border-radius:50%; background:rgba(255,255,255,.4); transform:scale(0); animation:rippleAnim .6s ease-out; pointer-events:none; }
@keyframes rippleAnim { to { transform:scale(3); opacity:0; } }
.pc-card-hover { transition: transform .4s cubic-bezier(.2,.8,.2,1), box-shadow .4s ease, border-color .4s ease; }
.pc-card-hover:hover { transform: translateY(-8px); box-shadow: 0 25px 50px -15px rgba(255,90,31,.18); }

#cursorGlow { position:fixed; width:320px; height:320px; border-radius:50%; pointer-events:none; z-index:2;
  background:radial-gradient(circle, rgba(255,90,31,.06) 0%, transparent 70%);
  transform:translate(-50%,-50%); opacity:0; transition:opacity .3s ease; }
@media (hover:hover) and (pointer:fine){ #cursorGlow.active{ opacity:1; } }
@media (hover:none){ #cursorGlow{ display:none; } }

#toastHost { position:fixed; bottom:96px; left:50%; transform:translateX(-50%); z-index:10002; display:flex; flex-direction:column; gap:8px; }
.mtoast { background:#0B0E14; color:#fff; padding:12px 22px; border-radius:99px; font-size:.8rem; font-weight:600;
  border:1px solid rgba(255,90,31,.3); box-shadow:0 12px 30px rgba(0,0,0,.25);
  opacity:0; transform:translateY(12px); animation:toastIn .35s ease forwards, toastOut .35s ease 2.4s forwards; }
@keyframes toastIn{ to{opacity:1;transform:translateY(0);} }
@keyframes toastOut{ to{opacity:0;transform:translateY(-8px);} }

.mmodal-backdrop { position:fixed; inset:0; background:rgba(11,14,20,.6); backdrop-filter:blur(6px); z-index:9998;
  opacity:0; pointer-events:none; transition:opacity .3s ease; }
.mmodal-backdrop.open { opacity:1; pointer-events:all; }
.mmodal { position:fixed; inset:0; z-index:9999; display:flex; align-items:center; justify-content:center; padding:16px;
  opacity:0; pointer-events:none; transition:opacity .3s ease; }
.mmodal.open { opacity:1; pointer-events:all; }
.mmodal-panel { transform:scale(.94) translateY(10px); transition:transform .35s cubic-bezier(.34,1.56,.64,1); }
.mmodal.open .mmodal-panel { transform:scale(1) translateY(0); }

.safe-bottom { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ── DEFENSIVE responsive nav rules — plain CSS, NOT dependent on
   Tailwind's CDN JIT engine, so the nav can never "fail to appear"
   even if the Tailwind script has trouble in some environment. ── */
.desktop-nav { display: none; }
.mobile-toggle { display: flex; }
#mobileTabBar { display: block; }
@media (min-width: 1024px) {
  .desktop-nav { display: flex !important; }
  .mobile-toggle { display: none !important; }
  #mobileTabBar { display: none !important; }
}

.pc-lang-switcher .pc-lang-btn { background:rgba(11,14,20,.05)!important; border:1px solid rgba(11,14,20,.12)!important; border-radius:99px!important; }
.pc-lang-switcher .pc-lang-panel { background:#fff!important; border:1px solid rgba(255,90,31,.2)!important; }