/* ═══════════════════════════════════════════════════════════
   IT BOY — v4 Refinements CSS
   R01 Loading Screen | R02 Temp Image Frame | R03 Cursor Off
   R04 Spline Label Hide | R05 Bubble Position | R07 Gallery
   R08 SEO structure | R09 Responsive polish
   ═══════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════
   R03 — Remove all custom cursor, restore OS cursor
══════════════════════════════════════════════════ */
* { cursor: auto !important; }
a, button, [role="button"], [data-page], [data-scroll],
.portfolio-card, .service-prev-card, .filter-btn,
.theme-toggle-wrap, .wa-float, .nav-cta, .btn {
  cursor: pointer !important;
}
#cursor, #cursor-ring { display: none !important; }
#heroSection { cursor: auto !important; }


/* ══════════════════════════════════════════════════
   R04 — Hide Spline "Built with Spline" watermark
══════════════════════════════════════════════════ */
spline-viewer::part(logo),
spline-viewer [class*="logo"],
spline-viewer [class*="watermark"],
spline-viewer [class*="badge"],
spline-viewer [class*="built"],
spline-viewer a[href*="spline"],
spline-viewer div[style*="bottom"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
/* Belt-and-suspenders via JS shadow DOM injection */


/* ══════════════════════════════════════════════════
   R01 — Loading Screen
══════════════════════════════════════════════════ */
#loadingScreen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
#loadingScreen.ls-hiding {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}
#loadingScreen.ls-gone { display: none !important; }

.ls-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 50% 45%, #0d1626 0%, #080b10 60%, #050608 100%);
}
.ls-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 60% at 50% 50%, rgba(26,86,219,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 30% 30% at 20% 80%, rgba(26,86,219,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 25% 25% at 80% 20%, rgba(59,130,246,0.06) 0%, transparent 60%);
}

.ls-scan-line {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(26,86,219,0.6), transparent);
  animation: lsScan 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}
@keyframes lsScan {
  0%   { top: 0%;   opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.ls-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  animation: lsContentIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes lsContentIn {
  0%   { opacity: 0; transform: translateY(20px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* Logo wrap */
.ls-logo-wrap {
  position: relative;
  width: 120px; height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ls-glow-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1.5px solid rgba(26,86,219,0.3);
  animation: lsRing 2s ease-in-out infinite;
}
.ls-glow-ring-2 {
  inset: -24px;
  border-color: rgba(26,86,219,0.15);
  animation-delay: 0.4s;
}
@keyframes lsRing {
  0%, 100% { transform: scale(1);    opacity: 0.5; }
  50%       { transform: scale(1.06); opacity: 1;   }
}

.ls-logo {
  width: 96px; height: 96px;
  object-fit: contain;
  border-radius: 20px;
  filter: drop-shadow(0 0 24px rgba(26,86,219,0.5));
  animation: lsLogoPulse 2.5s ease-in-out infinite;
}
@keyframes lsLogoPulse {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(26,86,219,0.45)); }
  50%       { filter: drop-shadow(0 0 32px rgba(59,130,246,0.7)); }
}

/* Fallback text logo */
.ls-logo-fallback {
  position: absolute;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #f0f2f5;
  letter-spacing: 2px;
  display: none;
}
.ls-logo-fallback span { color: #3b82f6; }
.ls-logo[style*="display:none"] ~ .ls-logo-fallback,
.ls-logo:not([src]) ~ .ls-logo-fallback { display: block; }

/* Tagline */
.ls-tagline {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(157,168,183,0.8);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  animation: lsFade 1.2s ease forwards 0.3s;
  opacity: 0;
}
@keyframes lsFade {
  to { opacity: 1; }
}

/* Progress bar */
.ls-bar-wrap {
  width: 180px;
  animation: lsFade 0.6s ease forwards 0.5s;
  opacity: 0;
}
.ls-bar {
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.ls-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1a56db, #3b82f6, #60a5fa);
  border-radius: 2px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px rgba(59,130,246,0.6);
}


/* ══════════════════════════════════════════════════
   R02 — Temp Image Frame: Soft Glass Treatment
   (apply to .temp-img-frame, .about-intro-img,
    img.temp-image, or any img in .about-intro-grid)
══════════════════════════════════════════════════ */
.temp-img-frame,
.about-intro-grid img,
.about-visual img,
img.temp-image {
  border-radius: 24px;
  border: none !important;
  outline: none !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 20px 60px rgba(0,0,0,0.5),
    0 0 40px rgba(26,86,219,0.1);
  mask-image: radial-gradient(ellipse 95% 92% at 50% 50%, black 60%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 95% 92% at 50% 50%, black 60%, transparent 100%);
}
/* Wrapper treatment for about visual cards area */
.about-visual {
  position: relative;
}
.about-visual::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(ellipse 80% 70% at 50% 50%, rgba(26,86,219,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.about-visual > * { position: relative; z-index: 1; }


/* ══════════════════════════════════════════════════
   R07 — Portfolio Lightbox
══════════════════════════════════════════════════ */
/* Enhanced portfolio card hover */
.portfolio-card {
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.35s ease,
              border-color 0.3s ease !important;
}
.portfolio-card:hover {
  transform: translateY(-8px) scale(1.01) !important;
}

/* Lightbox overlay */
.plb-overlay {
  position: fixed;
  inset: 0;
  z-index: 50000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.plb-overlay.plb-open {
  opacity: 1;
  pointer-events: auto;
}
.plb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5,7,10,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.plb-dialog {
  position: relative;
  z-index: 2;
  background: var(--bg-card, #161a1e);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 24px;
  width: min(860px, 92vw);
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,0.7), 0 0 60px rgba(26,86,219,0.1);
  display: grid;
  grid-template-rows: auto 1fr;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.plb-overlay.plb-open .plb-dialog {
  transform: scale(1) translateY(0);
}

/* Media area */
.plb-media-wrap {
  width: 100%;
  height: 400px;
  background: var(--bg-secondary, #111416);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.plb-media-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.plb-media-icon {
  font-size: 6rem;
  opacity: 0.35;
  user-select: none;
}
.plb-video-placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(147,51,234,0.1), rgba(168,85,247,0.05));
}
.plb-play-btn {
  width: 72px; height: 72px;
  background: rgba(26,86,219,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease;
  box-shadow: 0 0 30px rgba(26,86,219,0.5);
}
.plb-play-btn:hover { transform: scale(1.1); background: var(--brand-light, #3b82f6); }

/* Info panel */
.plb-info {
  padding: 28px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plb-badge {
  display: inline-flex;
  padding: 4px 12px;
  background: rgba(26,86,219,0.12);
  border: 1px solid rgba(26,86,219,0.25);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-light, #3b82f6);
  width: fit-content;
}
.plb-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary, #f0f2f5);
  line-height: 1.2;
}
.plb-desc {
  font-size: 0.9rem;
  color: var(--text-secondary, #9da8b7);
  line-height: 1.7;
  margin-bottom: 4px;
}

/* Nav arrows — R01: moved to overlay level (fixed positioning), never clipped */
.plb-nav {
  position: fixed;
  /* Dialog is centred. Media area is 400px tall. Info panel ~180px.
     Total dialog ~580px. Media midpoint = viewport_mid - 90px */
  top: calc(50% - 90px);
  transform: translateY(-50%);
  z-index: 50010;

  width:  58px;
  height: 58px;
  border-radius: 50%;
  background: var(--brand, #1a56db);
  border: 2.5px solid rgba(255,255,255,0.35);
  color: #ffffff;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0  4px 18px rgba(0,0,0,0.60),
    0  0   0  1px rgba(255,255,255,0.12),
    0  0  28px rgba(26,86,219,0.45);
  transition: background 0.22s ease,
              transform  0.22s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.22s ease,
              opacity    0.25s ease;
  pointer-events: auto;
  user-select: none;
}
/* Position outside dialog edges, but still on top of the media area */
.plb-prev { left:  max(12px, calc(50% - min(430px, 46vw) - 46px)); }
.plb-next { right: max(12px, calc(50% - min(430px, 46vw) - 46px)); }

.plb-nav:hover {
  background: var(--brand-light, #3b82f6);
  transform: translateY(-50%) scale(1.14);
  box-shadow:
    0  6px 28px rgba(0,0,0,0.55),
    0  0   0  2px rgba(255,255,255,0.22),
    0  0  40px rgba(59,130,246,0.60);
}
.plb-nav:active { transform: translateY(-50%) scale(0.95); }
.plb-nav[style*="opacity: 0.3"],
.plb-nav[style*="opacity:0.3"] {
  background: rgba(26,50,120,0.55);
  border-color: rgba(255,255,255,0.1);
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

[data-theme="light"] .plb-nav {
  background: var(--brand, #1a56db);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
  box-shadow: 0 4px 18px rgba(26,86,219,0.50), 0 0 28px rgba(26,86,219,0.30);
}
[data-theme="light"] .plb-nav:hover {
  background: var(--brand-light, #3b82f6);
  box-shadow: 0 6px 28px rgba(26,86,219,0.55), 0 0 40px rgba(59,130,246,0.45);
}
[data-theme="light"] .plb-nav[style*="opacity: 0.3"],
[data-theme="light"] .plb-nav[style*="opacity:0.3"] {
  background: rgba(26,86,219,0.25);
  box-shadow: none;
}

/* Close button */
.plb-close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 10;
  width: 36px; height: 36px;
  background: rgba(12,14,16,0.8);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  color: var(--text-secondary, #9da8b7);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}
.plb-close:hover {
  background: rgba(220,38,38,0.7);
  border-color: #ef4444;
  color: #fff;
  transform: rotate(90deg);
}

/* Light mode adjustments */
[data-theme="light"] .plb-dialog { background: #fff; border-color: rgba(26,86,219,0.15); }
[data-theme="light"] .plb-media-wrap { background: #f5f7fa; }
[data-theme="light"] .plb-close { background: rgba(245,247,250,0.9); }
/* .plb-nav light mode handled above in main nav rule */


/* ══════════════════════════════════════════════════
   R08 SEO — Semantic heading hierarchy helpers
══════════════════════════════════════════════════ */
/* Ensure H1 only on hero and page-hero, H2 on sections */
.page-hero h1 { /* already styled — no override needed */ }


/* ══════════════════════════════════════════════════
   R09 — Device Optimization: Responsive polish
══════════════════════════════════════════════════ */

/* Fluid type scale */
:root {
  --fs-hero:    clamp(2.2rem, 5vw, 3.8rem);
  --fs-section: clamp(1.7rem, 3.5vw, 3rem);
  --fs-card:    clamp(1rem, 2vw, 1.2rem);
}
.hero-content h1    { font-size: var(--fs-hero); }
.section-title      { font-size: var(--fs-section); }

/* ── 1280px+ desktops ── */
@media (min-width: 1280px) {
  .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-3         { grid-template-columns: repeat(3, 1fr); }
  .grid-4         { grid-template-columns: repeat(4, 1fr); }
  .services-preview-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── 1024px tablets landscape ── */
@media (max-width: 1024px) {
  .container, .container-wide { padding: 0 24px; }
  .site-header { padding: 0 24px; }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .plb-dialog { width: min(740px, 94vw); }
  .plb-media-wrap { height: 320px; }
}

/* ── 768px tablets portrait ── */
@media (max-width: 768px) {
  .container, .container-wide { padding: 0 18px; }
  .site-header { padding: 0 18px; }
  .section { padding: 60px 0; }
  .page-hero { padding: 130px 0 55px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3     { grid-template-columns: 1fr; }
  .grid-4     { grid-template-columns: repeat(2, 1fr); }
  .portfolio-grid { grid-template-columns: 1fr; }
  .footer-grid    { grid-template-columns: 1fr; gap: 36px; }
  .plb-dialog { grid-template-rows: auto auto; }
  .plb-media-wrap { height: 260px; }
  .plb-info { padding: 20px 22px 24px; }
  /* Mobile: smaller fixed-position buttons, hug viewport edges */
  .plb-nav  { width: 44px; height: 44px; font-size: 1.4rem; top: calc(50% - 110px); }
  .plb-prev { left:  8px; }
  .plb-next { right: 8px; }
}

/* ── 480px mobile ── */
@media (max-width: 480px) {
  .section { padding: 50px 0; }
  .container { padding: 0 14px; }
  .stats-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .portfolio-filters { gap: 6px; }
  .filter-btn { padding: 7px 12px; font-size: 0.78rem; }
  .plb-media-wrap { height: 220px; }
  .plb-title { font-size: 1.2rem; }
  .plb-info { padding: 16px 18px 20px; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 8px; }
  .cta-band-inner { flex-direction: column; text-align: center; }
  .cta-band-actions { justify-content: center; }
}

/* ── Ultra-wide 1920px+ ── */
@media (min-width: 1920px) {
  .container { max-width: 1380px; }
  .container-wide { max-width: 1600px; }
}

/* ── 4K / 2560px+ ── */
@media (min-width: 2560px) {
  :root { font-size: 18px; }
  .container { max-width: 1600px; }
}

/* Loading screen responsive */
@media (max-width: 480px) {
  .ls-logo      { width: 76px; height: 76px; }
  .ls-logo-wrap { width: 92px; height: 92px; }
  .ls-bar-wrap  { width: 140px; }
}
