/* Positive 4 Design ~ interaction layer (Nov 2026)
   Loaded after styleposdes.css. Everything here is progressive:
   the site reads and works the same with this file or the script missing. */

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

/* Scroll progress bar */
#p4dProgress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, #00c3ff, #b46bff);
  box-shadow: 0 0 8px rgba(0, 195, 255, .7);
  z-index: 2000; pointer-events: none;
}

/* Portfolio cards as browser windows */
.portfolio_item {
  background: #0d1030;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.portfolio_item::before {
  content: attr(data-url);
  display: block; height: 30px; padding: 0 12px 0 64px;
  font: 12px/30px ui-monospace, SFMono-Regular, Consolas, monospace;
  color: rgba(255, 255, 255, .65);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background:
    radial-gradient(circle at 16px 15px, #ff5f57 5px, transparent 6px),
    radial-gradient(circle at 32px 15px, #febc2e 5px, transparent 6px),
    radial-gradient(circle at 48px 15px, #28c840 5px, transparent 6px),
    #1a1d45;
}
.portfolio_item img { display: block; width: 100%; height: auto; }
.portfolio_item .portfolio_content,
.portfolio_item:hover .portfolio_content {
  position: static; transform: none; background: transparent;
  padding: 18px 20px 22px;
}
.portfolio_item .portfolio_content p { margin-bottom: .5rem; }
.portfolio_item:hover {
  border-color: rgba(0, 195, 255, .55);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45), 0 0 24px rgba(0, 195, 255, .18);
}

/* Cursor spotlight on cards */
.service_card, .service_feature, .process_step { position: relative; }
.service_card::after, .service_feature::after, .process_step::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 195, 255, .16), transparent 70%);
  opacity: 0; transition: opacity .25s ease; pointer-events: none;
}
.service_card:hover::after, .service_feature:hover::after, .process_step:hover::after { opacity: 1; }
.package_card { transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease; }
.package_card:hover { border-color: rgba(0, 195, 255, .55); box-shadow: 0 14px 34px rgba(0, 0, 0, .4); }

/* Reveal on scroll (classes are added by the script, so no-JS visitors see everything) */
.p4d-reveal { opacity: 0; transform: translateY(26px); }
.p4d-reveal.p4d-in {
  opacity: 1; transform: none;
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--p4d-delay, 0ms);
}

/* Back to top */
#p4dTop {
  position: fixed; right: 20px; bottom: 20px; width: 44px; height: 44px;
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 50%;
  background: rgba(0, 0, 34, .7); color: #fff; font-size: 20px; line-height: 1;
  cursor: pointer; z-index: 1500;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, border-color .25s ease;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
#p4dTop.p4d-show { opacity: 1; transform: none; pointer-events: auto; }
#p4dTop:hover, #p4dTop:focus-visible { border-color: #00c3ff; outline: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .p4d-reveal, .p4d-reveal.p4d-in { opacity: 1; transform: none; transition: none; }
  .portfolio_item, .package_card, #p4dTop { transition: none; }
}

/* Live demo strip */
.demo_section { background: rgba(0, 0, 0, .28); }
.p4d-demo { max-width: 1040px; margin: 0 auto; }
.p4d-demo__tabs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 18px; }
.p4d-demo__tab {
  padding: 9px 20px; border-radius: 999px; font-weight: 600; font-size: 15px;
  color: #fff; background: rgba(0, 0, 34, .45); border: 1px solid rgba(255, 255, 255, .22);
  text-decoration: none; transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.p4d-demo__tab:hover, .p4d-demo__tab:focus-visible { color: #fff; text-decoration: none; border-color: #00c3ff; outline: none; }
.p4d-demo__tab.is-active { background: #00c3ff; border-color: #00c3ff; color: #00122b; }
.p4d-demo__window {
  border-radius: 14px; overflow: hidden; background: #0d1030;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 40px rgba(0, 195, 255, .12);
}
.p4d-demo__bar {
  display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 14px 0 68px;
  font: 12px/38px ui-monospace, SFMono-Regular, Consolas, monospace; color: rgba(255, 255, 255, .7);
  background:
    radial-gradient(circle at 18px 19px, #ff5f57 5px, transparent 6px),
    radial-gradient(circle at 34px 19px, #febc2e 5px, transparent 6px),
    radial-gradient(circle at 50px 19px, #28c840 5px, transparent 6px),
    #1a1d45;
}
.p4d-demo__url { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p4d-demo__open { color: #7fdcff; white-space: nowrap; font-family: inherit; }
.p4d-demo__open:hover { color: #fff; }
.p4d-demo__stage { position: relative; height: clamp(420px, 68vh, 660px); background: #070920; }
.p4d-demo__stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.p4d-demo__poster[hidden] { display: none; }
.p4d-demo__poster {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 100% 32px,
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 32px 100%,
    radial-gradient(600px circle at 20% 15%, rgba(0, 195, 255, .28), transparent 60%),
    radial-gradient(600px circle at 85% 90%, rgba(180, 107, 255, .30), transparent 60%),
    #0a0c2a;
}
.p4d-demo__poster h3 { font-size: clamp(1.5rem, 3.2vw, 2.2rem); margin-bottom: .6rem; }
.p4d-demo__poster p { max-width: 520px; margin: 0 auto 1.4rem; color: rgba(255, 255, 255, .85); }
.p4d-demo__launch {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 28px; border: 0; border-radius: 999px;
  font-weight: 700; font-size: 16px; color: #00122b; cursor: pointer;
  background: linear-gradient(90deg, #00c3ff, #7fdcff);
  box-shadow: 0 0 0 0 rgba(0, 195, 255, .6); animation: p4dPulse 2.2s ease-out infinite;
}
.p4d-demo__launch::before { content: ""; border-left: 12px solid #00122b; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.p4d-demo__launch:hover, .p4d-demo__launch:focus-visible { filter: brightness(1.08); outline: none; }
.p4d-demo__note { margin-top: 14px; font-size: 14px; text-align: center; color: rgba(255, 255, 255, .75); }
@keyframes p4dPulse { 0% { box-shadow: 0 0 0 0 rgba(0, 195, 255, .55); } 100% { box-shadow: 0 0 0 22px rgba(0, 195, 255, 0); } }
@media (max-width: 575px) { .p4d-demo__stage { height: 72vh; } .p4d-demo__bar { padding-left: 62px; } }
@media (prefers-reduced-motion: reduce) { .p4d-demo__launch { animation: none; } }

/* Single-message hero on service pages */
.p4d-hero .detail-box { text-shadow: 0 2px 14px rgba(0, 0, 20, .55); }
.p4d-hero .detail-box h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.12; margin-bottom: 1rem; }
.p4d-hero .detail-box p { font-size: 1.15rem; max-width: 560px; }
.p4d-hero .detail-box .btn-box { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6rem; }
.p4d-hero .detail-box .btn-box a { margin: 0; text-shadow: none; }
.p4d-hero .detail-box .btn-box a.p4d-ghost { background: transparent; border: 2px solid #fff; color: #fff; }
.p4d-hero .detail-box .btn-box a.p4d-ghost:hover { background: #fff; color: #00122b; }
.p4d-hero { background: linear-gradient(90deg, rgba(0, 0, 30, .6), rgba(0, 0, 30, .25) 55%, rgba(0, 0, 30, 0)); }
@media (max-width: 767px) { .p4d-hero { background: rgba(0, 0, 30, .42); } }
