/* ============================================================================
   SITE EFFECTS - shared by every page (linked last in <head>, after the page's
   own styles, so these rules win ties)
   ----------------------------------------------------------------------------
   1. Glass card backgrounds
   2. Pop-up reveal on scroll (effects.js adds .na-pop to cards, section
      headers and images; the existing .reveal and data-delay reveals are
      given the same pop below)
   3. Small-screen fixes (long email addresses, hero headline size < 360px)

   Two page families load this file:
     - index / about / contact / dubai / next-boss: compiled tailwind.css + style.css
     - every other page: Tailwind CDN + an inline <style>
   Card fills are Tailwind arbitrary classes in both, so cards are matched by
   their exact class tokens ([class~=...]), never by a substring.
   ============================================================================ */

:root {
  /* top highlight · faint white corner sheen · gold corner glow · navy tint.
     The white is kept low on purpose: more white washes out the card text. */
  --na-glass:
    linear-gradient(rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.09)) top center / 100% 1px no-repeat,
    radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, 0.035), transparent 50%),
    radial-gradient(90% 80% at 100% 100%, rgba(212, 157, 52, 0.045), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.005) 60%),
    rgba(8, 14, 36, 0.56);
  --na-glass-hover:
    linear-gradient(rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.13)) top center / 100% 1px no-repeat,
    radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, 0.05), transparent 50%),
    radial-gradient(90% 80% at 100% 100%, rgba(212, 157, 52, 0.06), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.008) 60%),
    rgba(12, 20, 46, 0.58);
  --na-glass-blur: blur(14px) saturate(140%);
}

/* ---------------------------------------------------------------------------
   1. GLASS CARDS
   Only the background changes. Border, radius, shadow, padding and content are
   the card's own. A card = a rounded (not pill) + bordered block on one of the
   site's dark card fills. Gold-tinted panels, pills, buttons and form fields
   are left alone. Keep this list in sync with CARD_SEL in effects.js.
   --------------------------------------------------------------------------- */
:is(div, a, article, aside, section, li, figure, details, form):is(
  [class~="bg-[#070C1C]"], [class~="bg-[#05091A]"], [class~="bg-[#0C1430]"],
  [class~="bg-[#0A1128]"], [class~="bg-[#0B1533]"], [class~="bg-[#101A3B]"],
  [class~="bg-[#070C1C]/60"], [class~="bg-[#0A1128]/90"],
  [class~="bg-white/[.02]"], [class~="bg-white/[.03]"],
  [class~="bg-gradient-to-br"]:is([class~="from-[#0A1128]"], [class~="from-[#070C1C]"], [class~="from-[#0C1430]"]),
  [style*="background:#0C1430"], [style*="background:linear-gradient(135deg,#070C1C,#0C1430)"]
)[class*="rounded-"][class*="border"]:not([class~="rounded-full"]) {
  background: var(--na-glass) !important;
  -webkit-backdrop-filter: var(--na-glass-blur);
  backdrop-filter: var(--na-glass-blur);
}

/* cards that had a hover fill get a brighter glass on hover instead */
:is(div, a, article, aside, section, li, figure, details, form):is(
  [class~="bg-[#070C1C]"], [class~="bg-[#05091A]"], [class~="bg-[#0C1430]"],
  [class~="bg-[#0A1128]"], [class~="bg-[#0B1533]"], [class~="bg-[#101A3B]"],
  [class~="bg-[#070C1C]/60"], [class~="bg-[#0A1128]/90"],
  [class~="bg-white/[.02]"], [class~="bg-white/[.03]"],
  [class~="bg-gradient-to-br"]:is([class~="from-[#0A1128]"], [class~="from-[#070C1C]"], [class~="from-[#0C1430]"]),
  [style*="background:#0C1430"], [style*="background:linear-gradient(135deg,#070C1C,#0C1430)"]
)[class*="rounded-"][class*="border"]:not([class~="rounded-full"])[class*="hover:bg-"]:hover {
  background: var(--na-glass-hover) !important;
}

/* A glass card inside a glass card keeps the glass fill but skips its own
   blur: the outer card already blurs what is behind, and stacked backdrop
   filters are expensive to scroll. */
:is(
  [class~="bg-[#070C1C]"], [class~="bg-[#05091A]"], [class~="bg-[#0C1430]"],
  [class~="bg-[#0A1128]"], [class~="bg-[#0B1533]"], [class~="bg-[#101A3B]"],
  [class~="bg-[#070C1C]/60"], [class~="bg-[#0A1128]/90"],
  [class~="bg-white/[.02]"], [class~="bg-white/[.03]"],
  [class~="bg-gradient-to-br"], [style*="background:#0C1430"],
  [style*="background:linear-gradient(135deg,#070C1C,#0C1430)"]
)[class*="rounded-"][class*="border"] :is(
  [class~="bg-[#070C1C]"], [class~="bg-[#05091A]"], [class~="bg-[#0C1430]"],
  [class~="bg-[#0A1128]"], [class~="bg-[#0B1533]"], [class~="bg-[#101A3B]"],
  [class~="bg-[#070C1C]/60"], [class~="bg-[#0A1128]/90"],
  [class~="bg-white/[.02]"], [class~="bg-white/[.03]"],
  [class~="bg-gradient-to-br"], [style*="background:#0C1430"],
  [style*="background:linear-gradient(135deg,#070C1C,#0C1430)"]
)[class*="rounded-"][class*="border"] {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Readable text on glass. The site's dim greys (#55618A ~3:1, #4E5B7E) and the
   40% gold step numbers were tuned for solid navy cards; on glass they go
   muddy. Inside glass cards they are lifted to clear, readable tones.
   Specificity is pinned at (0,1,1): the card part sits in :where() (zero)
   and the tag list adds one element. That beats the plain Tailwind colour
   class (0,1,0) whichever stylesheet loads last, yet loses to the cards' own
   hover:text-* (0,2,0) and group-hover:text-* (0,3,0), so hover colours
   still apply and hovered text never drops back to the dim grey. */
:where(:is(
  [class~="bg-[#070C1C]"], [class~="bg-[#05091A]"], [class~="bg-[#0C1430]"],
  [class~="bg-[#0A1128]"], [class~="bg-[#0B1533]"], [class~="bg-[#101A3B]"],
  [class~="bg-[#070C1C]/60"], [class~="bg-[#0A1128]/90"],
  [class~="bg-white/[.02]"], [class~="bg-white/[.03]"],
  [class~="bg-gradient-to-br"], [style*="background:#0C1430"],
  [style*="background:linear-gradient(135deg,#070C1C,#0C1430)"]
)[class*="rounded-"][class*="border"]) :is(p, span, div, a, li, ul, ol, h2, h3, h4, h5, h6, small, strong, b, em, i, label, button, address, nav, time, td, dd, dt, svg):is([class~="text-[#55618A]"], [class~="text-[#4E5B7E]"]) {
  color: #929EBD;
}
:where(:is(
  [class~="bg-[#070C1C]"], [class~="bg-[#05091A]"], [class~="bg-[#0C1430]"],
  [class~="bg-[#0A1128]"], [class~="bg-[#0B1533]"], [class~="bg-[#101A3B]"],
  [class~="bg-[#070C1C]/60"], [class~="bg-[#0A1128]/90"],
  [class~="bg-white/[.02]"], [class~="bg-white/[.03]"],
  [class~="bg-gradient-to-br"], [style*="background:#0C1430"],
  [style*="background:linear-gradient(135deg,#070C1C,#0C1430)"]
)[class*="rounded-"][class*="border"]) :is(p, span, div, a, li, ul, ol, h2, h3, h4, h5, h6, small, strong, b, em, i, label, button, address, nav, time, td, dd, dt, svg)[class~="text-[#9AA6C4]"] {
  color: #B1BBD3;
}
:where(:is(
  [class~="bg-[#070C1C]"], [class~="bg-[#05091A]"], [class~="bg-[#0C1430]"],
  [class~="bg-[#0A1128]"], [class~="bg-[#0B1533]"], [class~="bg-[#101A3B]"],
  [class~="bg-white/[.02]"], [class~="bg-white/[.03]"]
)[class*="rounded-"][class*="border"]) :is(p, span, div, a, li, h2, h3, h4, h5, h6, small, strong, b, em, i, label, button, time, td, dd, dt, svg)[class~="text-[#D49D34]/40"] {
  color: rgba(212, 157, 52, 0.85);
}

/* The Next Boss product shot is a transparent image (dashboard frame, caption
   and faint grid only); the glass card is painted behind it here. */
img[src$="next-boss-app-glass.webp"] {
  background: var(--na-glass);
  -webkit-backdrop-filter: var(--na-glass-blur);
  backdrop-filter: var(--na-glass-blur);
}

@media (max-width: 767px) {
  :root { --na-glass-blur: blur(10px) saturate(135%); }
}

/* ---------------------------------------------------------------------------
   2. POP-UP REVEAL
   effects.js marks elements with .na-pop (hidden) and swaps it for
   .na-pop-in when they scroll into view. The keyframes only define the start
   frame, so each element springs back to its OWN opacity and transform.
   --------------------------------------------------------------------------- */
@keyframes na-pop-in {
  from { opacity: 0; transform: translate3d(0, 36px, 0) scale(0.94); }
}
.na-pop { opacity: 0; }
.na-pop-in {
  animation: na-pop-in 0.8s cubic-bezier(0.34, 1.42, 0.64, 1) both;
  animation-delay: var(--na-pop-delay, 0ms);
}

/* Existing reveals pop the same way.
   Standalone pages: .reveal -> .reveal.visible (inline script). Only the
   hidden state and the timing change; the visible state is the page's own. */
.reveal:not(.visible) { transform: translate3d(0, 32px, 0) scale(0.95); }
.reveal.reveal {
  transition: opacity 0.6s ease, transform 0.85s cubic-bezier(0.34, 1.42, 0.64, 1),
    background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}
/* index / about / contact / dubai / next-boss: script.js swaps
   opacity-0 translate-y-8 for opacity-100 translate-y-0. Add a scale to the
   hidden state and a springy curve to the reveal (not the fixed grid lines). */
[data-delay].opacity-0.translate-y-8:not(.fixed *) { --tw-scale-x: 0.95; --tw-scale-y: 0.95; }
[data-delay].translate-y-0:not(.fixed *) { transition-timing-function: cubic-bezier(0.34, 1.42, 0.64, 1); }

/* ---------------------------------------------------------------------------
   3. SMALL SCREENS (checked down to 300px wide)
   --------------------------------------------------------------------------- */
/* Email addresses have no spaces, so a long one cannot wrap and pushes its
   card (and the page) wider than a narrow phone. Let it break only when it
   does not fit; on wider screens nothing changes. */
a[href^="mailto:"] { overflow-wrap: anywhere; }

/* The big hero headlines (index 3.75rem, about + dubai 3rem at the 18px root)
   hold single words - "operations", "automation" - that are wider than a
   300-359px screen. Below 360px the size follows the screen width so the
   longest word always fits; min() means it only ever gets smaller. */
@media (max-width: 359px) {
  h1[class~="text-6xl"] { font-size: min(3.75rem, 21vw); }
  h1[class~="text-5xl"] { font-size: min(3rem, 16.5vw); }
}

@media (prefers-reduced-motion: reduce) {
  .na-pop { opacity: 1 !important; }
  .na-pop-in { animation: none !important; }
}
@media print {
  .na-pop { opacity: 1 !important; }
  .na-pop-in { animation: none !important; }
}
