/* ============================================================
   WebCloud Agency — light theme, signature effects
   ============================================================ */

/* ---------- background patterns ---------- */
.bg-grid {
  background-image:
    linear-gradient(rgba(1, 100, 166, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(1, 100, 166, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
}
.bg-grid-dark {
  background-image:
    linear-gradient(rgba(26, 143, 204, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 143, 204, 0.08) 1px, transparent 1px);
  background-size: 56px 56px;
}
.bg-dots {
  background-image: radial-gradient(rgba(1, 100, 166, 0.16) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
}

/* ---------- film grain ---------- */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- custom cursor ---------- */
#cursor-dot, #cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 80;
  pointer-events: none;
  border-radius: 9999px;
  opacity: 0;
}
#cursor-dot {
  width: 7px; height: 7px;
  background: #0164A6;
  transform: translate(-50%, -50%);
}
#cursor-ring {
  width: 38px; height: 38px;
  border: 1.5px solid rgba(1, 100, 166, 0.55);
  transform: translate(-50%, -50%);
  transition: width 0.25s, height 0.25s, border-color 0.25s, background 0.25s;
}
#cursor-ring.is-hover {
  width: 58px; height: 58px;
  border-color: rgba(26, 143, 204, 0.9);
  background: rgba(26, 143, 204, 0.08);
}
@media (pointer: coarse) {
  #cursor-dot, #cursor-ring { display: none; }
}
@media (pointer: fine) {
  body.cursor-ready { cursor: none; }
  body.cursor-ready a, body.cursor-ready button, body.cursor-ready label,
  body.cursor-ready input, body.cursor-ready textarea { cursor: none; }
}

/* ---------- giant outlined background word ---------- */
.word-bg {
  position: absolute;
  top: -0.28em;
  left: -0.02em;
  z-index: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(4.5rem, 14vw, 11rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(1, 100, 166, 0.13);
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}
.outline-text {
  color: transparent;
  -webkit-text-stroke: 2px #0164A6;
}
.outline-text-light {
  color: transparent;
  -webkit-text-stroke: 2px rgba(26, 143, 204, 0.7);
}

/* ---------- animated gradient headline word ---------- */
.gradient-word {
  background: linear-gradient(90deg, #0164A6, #1A8FCC, #38bdf8, #0164A6);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 6s ease infinite;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ---------- scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .animate-marquee, .animate-float-slow, .animate-float-slower,
  .animate-pulse-ring, .animate-spin-slow, .gradient-word { animation: none !important; }
  #cursor-dot, #cursor-ring { display: none; }
  body.cursor-ready, body.cursor-ready a, body.cursor-ready button { cursor: auto; }
}

/* ---------- glow following cursor on cards (light) ---------- */
.glow-card { position: relative; overflow: hidden; }
.glow-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%),
              rgba(26, 143, 204, 0.12), transparent 65%);
  pointer-events: none;
}
.glow-card:hover::before { opacity: 1; }

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

/* ---------- marquee ---------- */
.marquee-mask {
  -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}
.marquee-word {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1.1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(1, 100, 166, 0.35);
  transition: all 0.3s;
}
.marquee-row:hover .marquee-word { -webkit-text-stroke-color: rgba(1, 100, 166, 0.7); }
.marquee-word.filled {
  color: #0164A6;
  -webkit-text-stroke: 0;
}

/* ---------- typing caret in code windows ---------- */
.typing-caret::after {
  content: '▍';
  color: #1A8FCC;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- nav ---------- */
#site-nav.scrolled {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(1, 100, 166, 0.1);
  box-shadow: 0 4px 24px -12px rgba(1, 100, 166, 0.15);
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 1rem; right: 1rem; bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #0164A6, #1A8FCC);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); }

/* ---------- mobile menu: circular reveal ---------- */
.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 45; /* under the header (z-50) so logo & burger stay on top */
  background: radial-gradient(120% 120% at 100% 0%, #0B2237 0%, #071523 55%, #040B14 100%);
  clip-path: circle(0px at calc(100% - 42px) 44px);
  transition: clip-path 0.65s cubic-bezier(0.83, 0, 0.17, 1), visibility 0s 0.65s;
  visibility: hidden;
  pointer-events: none;
}
.mobile-overlay.open {
  clip-path: circle(160% at calc(100% - 42px) 44px);
  transition: clip-path 0.75s cubic-bezier(0.83, 0, 0.17, 1);
  visibility: visible;
  pointer-events: auto;
}

/* staggered fly-in of menu items */
.mobile-overlay .m-link {
  opacity: 0;
  transform: translateY(34px) rotate(1.5deg);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-overlay.open .m-link {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i) * 70ms + 280ms);
}

/* burger → ✕ morph */
.burger-line {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #0B2237;
  transition: transform 0.35s cubic-bezier(0.68, -0.4, 0.32, 1.4), opacity 0.25s, background 0.3s;
}
.burger-line + .burger-line { margin-top: 4px; }
body.menu-open .burger-line { background: #fff; }
body.menu-open .burger-line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.menu-open .burger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
body.menu-open .burger-line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* header adapts while menu is open (it sits above the dark overlay) */
body.menu-open #menu-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: none;
}
body.menu-open #site-nav,
body.menu-open #site-nav.scrolled {
  background: transparent;
  box-shadow: none;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.menu-open .logo-text { color: #fff; }
body.menu-open .logo-accent { color: #1A8FCC; }

@media (prefers-reduced-motion: reduce) {
  .mobile-overlay { transition: none; }
  .mobile-overlay .m-link { transition: none; }
}

/* ---------- magnetic buttons ---------- */
.magnetic {
  transition: transform 0.2s ease-out;
  will-change: transform;
}

/* ---------- portfolio filtering ---------- */
.project-card.filtered-out { display: none; }

/* ---------- booking form: selected type card ---------- */
.type-option:has(input:checked) {
  border-color: #0164A6;
  background: #EEF6FB;
  box-shadow: 0 0 0 1.5px rgba(1, 100, 166, 0.45);
}

/* ---------- scrollbar & selection ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #F5F9FC; }
::-webkit-scrollbar-thumb { background: #BBDCEF; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #1A8FCC; }
::selection { background: rgba(26, 143, 204, 0.25); color: #071523; }
