/* ============================================================
   POHPEH Motion Layer V3 — on top of Design System V2
   Hero motion · glass depth cards · marquee · workflow path
   scroll reveal · count-up · tilt · gradient borders · nav shrink
   Vanilla CSS only (JS engine: /motion.js). No build deps.
   prefers-reduced-motion respected (final block).
   ============================================================ */

/* ---------- 1. HERO MOTION ---------- */
.hero-motion { overflow: hidden; }

.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
}
.hero-bg-img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: .32; filter: saturate(1.1) brightness(.9);
  transform: scale(1.06);
  animation: ph-hero-pan 44s ease-in-out infinite alternate;
}
@keyframes ph-hero-pan {
  from { transform: scale(1.06) translateX(-1.2%); }
  to   { transform: scale(1.13) translateX(1.2%); }
}

.hero-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 520px at 15% -10%, rgba(0,180,184,.26), transparent 60%),
    radial-gradient(820px 460px at 85% 0%, rgba(124,92,255,.22), transparent 60%),
    radial-gradient(720px 420px at 50% 115%, rgba(255,107,53,.14), transparent 60%);
  animation: ph-glow-drift 16s ease-in-out infinite alternate;
}
@keyframes ph-glow-drift {
  0%   { opacity: .72; transform: translate(0, 0); }
  100% { opacity: 1;   transform: translate(-1.6%, 1.2%); }
}

.hero-circuit { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.circuit-path { stroke: rgba(0,180,184,.55); stroke-width: 1.4; fill: none; stroke-linecap: round; stroke-dasharray: 7 11; animation: ph-dash 9s linear infinite; }
.circuit-path2 { stroke: rgba(124,92,255,.45); stroke-width: 1.1; fill: none; stroke-linecap: round; stroke-dasharray: 4 13; animation: ph-dash 13s linear infinite reverse; }
.circuit-path3 { stroke: rgba(255,107,53,.35); stroke-width: 1; fill: none; stroke-linecap: round; stroke-dasharray: 3 15; animation: ph-dash 17s linear infinite; }
@keyframes ph-dash { to { stroke-dashoffset: -180; } }

.circuit-node { fill: #00B4B8; animation: ph-node 3.2s ease-in-out infinite; }
.circuit-node2 { fill: #FF6B35; animation: ph-node 4.4s ease-in-out infinite; }
@keyframes ph-node {
  0%, 100% { opacity: .22; }
  50% { opacity: 1; filter: drop-shadow(0 0 7px currentColor); }
}

.hero-particles { position: absolute; inset: 0; overflow: hidden; }
.ph-particle {
  position: absolute; bottom: -12px; border-radius: 50%;
  background: rgba(0,180,184,.85); box-shadow: 0 0 8px rgba(0,180,184,.8);
  animation: ph-rise linear infinite;
}
@keyframes ph-rise {
  0%   { transform: translateY(0); opacity: 0; }
  8%   { opacity: .9; }
  88%  { opacity: .5; }
  100% { transform: translateY(-105vh); opacity: 0; }
}

.hero-content { position: relative; z-index: 2; }
.hero-dashboard {
  position: relative; z-index: 2;
  max-width: 860px; margin: 52px auto 0;
  transform-style: preserve-3d; will-change: transform;
}

[data-parallax] { will-change: transform; }

/* ---------- 2. SCROLL REVEAL / STAGGER ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

.reveal-stagger { opacity: 1; }
.reveal-stagger > * { opacity: 0; transform: translateY(22px); transition: opacity .5s ease, transform .5s ease; }
.reveal-stagger.is-in > * { opacity: 1; transform: none; }
.reveal-stagger.is-in > *:nth-child(1) { transition-delay: .04s; }
.reveal-stagger.is-in > *:nth-child(2) { transition-delay: .12s; }
.reveal-stagger.is-in > *:nth-child(3) { transition-delay: .20s; }
.reveal-stagger.is-in > *:nth-child(4) { transition-delay: .28s; }
.reveal-stagger.is-in > *:nth-child(5) { transition-delay: .36s; }
.reveal-stagger.is-in > *:nth-child(6) { transition-delay: .44s; }

/* ---------- 3. GLASS DEPTH CARD ---------- */
.glass-visual {
  position: relative; overflow: hidden;
  border-radius: var(--ph-radius-lg);
  border: 1px solid var(--ph-border);
  background: var(--ph-surface);
  box-shadow: var(--ph-shadow-card), 0 30px 80px -30px rgba(0,180,184,.28);
  transform-style: preserve-3d;
}
.glass-visual img { width: 100%; height: auto; display: block; position: relative; z-index: 1; }
.glass-visual::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.07), transparent 42%);
}
.glass-glow {
  position: absolute; inset: -16%; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0,180,184,.20), transparent 72%);
  filter: blur(30px);
}

/* tilt target */
.tilt { transform-style: preserve-3d; transition: transform .22s ease-out; will-change: transform; }

/* ---------- 4. MARQUEE ---------- */
.marquee {
  position: relative; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  padding: 6px 0;
}
.marquee-track { display: flex; gap: 18px; width: max-content; animation: ph-marquee 30s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes ph-marquee { to { transform: translateX(-50%); } }
.marquee-chip {
  font-family: var(--ph-font-display); font-weight: 600; font-size: 1.02rem;
  color: var(--ph-text-muted); white-space: nowrap; letter-spacing: .02em;
  padding: 11px 22px; border: 1px solid var(--ph-border); border-radius: 14px;
  background: rgba(255,255,255,.025);
  transition: color .15s, border-color .15s, background .15s;
}
.marquee-chip:hover { color: var(--ph-text); border-color: var(--ph-border-strong); background: rgba(0,180,184,.08); }

/* ---------- 5. WORKFLOW CONNECTOR ---------- */
.workflow { position: relative; }
.workflow::before {
  content: ''; position: absolute; z-index: 0;
  top: 46px; left: 12%; right: 12%; height: 2px;
  background: linear-gradient(90deg, rgba(0,180,184,.55), rgba(124,92,255,.55), rgba(255,107,53,.45));
  transform: scaleX(0); transform-origin: left;
  transition: transform 1.3s ease .15s;
  border-radius: 2px;
}
.workflow.is-in::before { transform: scaleX(1); }
.wf-step { position: relative; z-index: 1; }
.wf-step::after {
  content: ''; position: absolute; z-index: 2;
  top: 50px; left: 50%; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ph-teal); box-shadow: 0 0 12px rgba(0,180,184,.9);
  transform: translateX(-50%) scale(0);
  transition: transform .4s ease .9s;
}
.wf-step.is-in::after { transform: translateX(-50%) scale(1); }

/* ---------- 6. ANIMATED GRADIENT BORDER ---------- */
.g-border { position: relative; }
.g-border::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.6px;
  background: linear-gradient(120deg, #00B4B8, #7C5CFF, #FF6B35, #00B4B8);
  background-size: 300% 300%;
  animation: ph-gradient 9s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none; z-index: 3;
}

/* ---------- 7. NAV SHRINK / BLUR ---------- */
.nav { transition: background .25s ease, box-shadow .25s ease, border-color .25s ease; }
.nav.scrolled { background: rgba(6,11,18,.94); box-shadow: 0 10px 36px -14px rgba(0,0,0,.65); border-bottom-color: rgba(0,180,184,.22); }
.nav.scrolled .nav-inner { height: 56px; }
.nav-inner { transition: height .25s ease; }

/* ---------- 8. SCAN BEAM (GEO) ---------- */
.scan-wrap { overflow: hidden; }
.scan-beam {
  position: absolute; z-index: 3; left: -5%; right: -5%; height: 130px; top: -30%;
  background: linear-gradient(180deg, transparent, rgba(0,180,184,.20), transparent);
  filter: blur(8px); pointer-events: none;
  animation: ph-scan 5.5s ease-in-out infinite;
}
@keyframes ph-scan {
  0%   { top: -30%; opacity: 0; }
  18%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { top: 112%; opacity: 0; }
}

/* ---------- 9. TERMINAL / CODE FLOW ---------- */
.terminal {
  background: #080E18; border: 1px solid var(--ph-border); border-radius: 14px;
  font-family: var(--ph-font-mono); font-size: .82rem; text-align: left;
  box-shadow: var(--ph-shadow-card), 0 24px 60px -24px rgba(124,92,255,.25);
  overflow: hidden;
}
.term-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--ph-border); background: rgba(255,255,255,.02); }
.term-head i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.term-head i:nth-child(1) { background: #FF5F57; }
.term-head i:nth-child(2) { background: #FEBC2E; }
.term-head i:nth-child(3) { background: #28C840; }
.term-head span { margin-left: 8px; color: var(--ph-text-dim); font-size: .74rem; }
.term-body { padding: 16px 18px; display: grid; gap: 9px; }
.term-line { display: flex; gap: 9px; align-items: baseline; opacity: 0; animation: ph-term-in .5s ease forwards; }
.term-line:nth-child(1) { animation-delay: .2s; }
.term-line:nth-child(2) { animation-delay: .55s; }
.term-line:nth-child(3) { animation-delay: .9s; }
.term-line:nth-child(4) { animation-delay: 1.25s; }
.term-line:nth-child(5) { animation-delay: 1.6s; }
@keyframes ph-term-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.term-prompt { color: var(--ph-teal); }
.term-ok { color: #4EE39A; }
.term-warn { color: #FFB86B; }
.term-dim { color: var(--ph-text-dim); }
.term-cursor { display: inline-block; width: 9px; height: 15px; background: var(--ph-teal); vertical-align: text-bottom; animation: ph-blink 1.05s step-end infinite; }
@keyframes ph-blink { 50% { opacity: 0; } }

/* ---------- 10. COUNT-UP / STATS ---------- */
.count-up { font-variant-numeric: tabular-nums; }
.stat-row { display: flex; gap: 26px; flex-wrap: wrap; }
.stat { background: var(--ph-surface); border: 1px solid var(--ph-border); border-radius: 14px; padding: 20px 24px; min-width: 150px; text-align: left; }
.stat-v { font-family: var(--ph-font-display); font-size: 2.3rem; font-weight: 700; color: var(--ph-text); line-height: 1.1; }
.stat-v .stat-suffix { color: var(--ph-teal); }
.stat-k { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ph-text-dim); font-weight: 600; margin-top: 6px; }

/* ---------- 11. PAGE TRANSITION (light) ---------- */
body { animation: ph-page-in .38s ease both; }
@keyframes ph-page-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* ---------- 12. SPLIT LAYOUTS FOR VISUAL SECTIONS ---------- */
.commerce-split, .geo-split, .dev-split, .integration-split, .workflow-split { align-items: center; }
.workflow-split .glass-visual { max-width: 480px; }
.integration-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .integration-grid { grid-template-columns: 1fr; } }

/* ---------- 14. HERO SPLIT LAYOUT (V3.1 — Dave's concept) ---------- */
.hero-split {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: 56px; align-items: center; text-align: left;
}
@media (max-width: 980px) {
  .hero-split { grid-template-columns: 1fr; gap: 48px; text-align: center; }
  .hero-left .lead, .hero-left .hero-cta { margin-left: auto; margin-right: auto; }
}
.hero-left { position: relative; z-index: 2; }
.hero-right { position: relative; z-index: 2; }

.hero-wordmark {
  font-family: var(--ph-font-display); font-weight: 700;
  font-size: clamp(3.2rem, 7vw, 5.2rem); line-height: 1;
  letter-spacing: -0.03em; color: #fff; margin: 6px 0 14px;
  display: flex; align-items: baseline;
}
.hero-wordmark .e { color: var(--ph-teal); text-shadow: 0 0 30px rgba(0,180,184,.65); }
.hero-wordmark .dot { color: var(--ph-orange); }
@media (max-width: 980px) { .hero-wordmark { justify-content: center; } }

.hero-motion .hero-title {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 600; margin-bottom: 16px;
  background: linear-gradient(120deg, #fff 35%, #7FE3E6 60%, #B9A8FF 85%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-motion .hero-left .lead { max-width: 560px; margin: 0 0 34px; }
@media (max-width: 980px) { .hero-motion .hero-left .lead { margin-left: auto; margin-right: auto; } }

/* ---------- 15. HERO DASHBOARD (AI-commerce widgets) ---------- */
.dash-wrap { position: relative; max-width: 520px; margin: 0 auto; }
.dash-core { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 3; width: 92px; height: 92px; }
.dash-hex {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--ph-font-display); font-weight: 700; font-size: 1.05rem; color: #fff;
  background: linear-gradient(135deg, var(--ph-orange), #E8552A);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  box-shadow: 0 0 34px rgba(255,107,53,.55);
  animation: ph-node 3.6s ease-in-out infinite;
}
.dash-circuit { position: absolute; inset: -30%; width: 160%; height: 160%; overflow: visible; }
.dc-line { fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 5 7; animation: ph-dash 7s linear infinite; }
.dc-line-a, .dc-line-b { stroke: rgba(0,180,184,.5); }
.dc-line-c, .dc-line-d { stroke: rgba(255,107,53,.45); }
.dc-line-b { animation-duration: 9s; animation-direction: reverse; }
.dc-line-d { animation-duration: 11s; animation-direction: reverse; }
.dc-node { fill: var(--ph-teal); animation: ph-node 2.6s ease-in-out infinite; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dash-card {
  position: relative;
  background: rgba(13,22,38,.68);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(0,180,184,.22);
  border-radius: 16px; padding: 16px 18px;
  box-shadow: 0 18px 50px -18px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
  z-index: 2;
  transition: border-color .2s, transform .2s;
}
.dash-card:hover { border-color: rgba(0,180,184,.45); }
.dc-1 { animation: ph-float 6.5s ease-in-out infinite; }
.dc-2 { animation: ph-float 7.5s ease-in-out .8s infinite; }
.dc-3 { animation: ph-float 8s ease-in-out 1.6s infinite; }
.dc-4 { animation: ph-float 6.8s ease-in-out 2.2s infinite; }
.dc-5 { animation: ph-float 7.2s ease-in-out 3s infinite; }
.dc-6 { animation: ph-float 8.4s ease-in-out 3.6s infinite; }
.dc-label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ph-text-dim); font-weight: 600; margin-bottom: 8px; }
.dc-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dc-value { font-family: var(--ph-font-display); font-size: 1.5rem; font-weight: 700; color: #fff; }
.dc-value-sm { font-size: 1.02rem; }
.dc-value-teal { color: #4FDCE0; }
.dc-up { font-size: .72rem; font-weight: 700; color: #4EE39A; white-space: nowrap; }
.dc-spark { width: 100%; height: 26px; margin-top: 10px; display: block; }
.dc-spark-line { fill: none; stroke: var(--ph-teal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(0,180,184,.7)); }
.dc-spark-amber .dc-spark-line { stroke: var(--ph-orange); filter: drop-shadow(0 0 4px rgba(255,107,53,.6)); }
.dc-bars { display: flex; align-items: flex-end; gap: 4px; height: 34px; margin-top: 10px; }
.dc-bars i { flex: 1; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--ph-teal), rgba(0,180,184,.25)); min-height: 6px; }
.dc-bars-teal i { background: linear-gradient(180deg, #4FDCE0, rgba(0,180,184,.2)); }
.dc-donut-wrap { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.dc-donut-wrap-sm { margin-top: 8px; }
.dc-donut {
  --p: 78;
  width: 62px; height: 62px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--ph-teal) calc(var(--p) * 1%), rgba(255,255,255,.08) 0);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.dc-donut::before {
  content: ''; position: absolute; inset: 9px; border-radius: 50%;
  background: rgba(13,22,38,.92);
}
.dc-donut span { position: relative; z-index: 1; font-family: var(--ph-font-display); font-weight: 700; font-size: .92rem; color: #fff; }
.dc-donut-orange { background: conic-gradient(var(--ph-orange) calc(var(--p) * 1%), rgba(255,255,255,.08) 0); }
.dc-donut-sub { font-size: .78rem; color: var(--ph-text-muted); }

@media (max-width: 640px) {
  .dash-grid { gap: 10px; }
  .dash-card { padding: 13px 14px; }
  .dc-value { font-size: 1.25rem; }
  .dash-core { width: 74px; height: 74px; }
}

/* BUGFIX RC1 — mobile: dashboard collapse ke 1 kolom + hex hidden (cramped 2-col)
   dan navbar: hide secondary "Masuk" + shrink CTA supaya tidak overflow */
@media (max-width: 480px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-core { display: none; }
  .dash-card { padding: 14px 16px; }
  .dc-value { font-size: 1.4rem; }
  .dc-label { font-size: .64rem; }
}
@media (max-width: 640px) {
  .nav-actions .btn-secondary { display: none; }
  .nav-actions .btn-primary { padding: 9px 16px; font-size: .88rem; }
  .nav-inner { gap: 10px; }
  .nav-brand { font-size: 1.15rem; }
  .lang-switch { padding: 6px 10px; font-size: .8rem; }
}
@media (max-width: 380px) {
  .nav-actions .lang-switch { display: none; }
  .nav-actions .btn-primary { padding: 9px 14px; }
}

/* reduced motion: stop dashboard float */
@media (prefers-reduced-motion: reduce) {
  .dc-1, .dc-2, .dc-3, .dc-4, .dc-5, .dc-6, .dash-hex, .dc-line, .dc-node { animation: none !important; }
}

/* ---------- 16. MISC UTILITIES ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-bg-img, .hero-glow, .circuit-path, .circuit-path2, .circuit-path3,
  .circuit-node, .circuit-node2, .ph-particle, .marquee-track, .scan-beam,
  .term-line, .term-cursor, .g-border::before, body {
    animation: none !important;
  }
  .workflow::before { transform: scaleX(1); transition: none; }
  .wf-step::after { transform: translateX(-50%) scale(1); transition: none; }
  .reveal, .reveal-stagger > * { opacity: 1; transform: none; transition: none; }
  .hero-bg-img { transform: scale(1.06); }
}
