/* ============================================================
   NewMedia — custom styles (supplements Tailwind)
   Brand: black & white base + electric-blue accent (#2F6BFF)
   ============================================================ */

:root {
  --accent: #2f6bff;
  --accent-dark: #1e4fd6;
  --ink: #0a0a0b;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Selection */
::selection { background: var(--accent); color: #fff; }

/* Focus — visible ring for keyboard users only */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---- Display headings tracking ---- */
.font-display { letter-spacing: -0.02em; }
.text-balance { text-wrap: balance; }

/* ---- Accent gradient text ---- */
.text-accent-gradient {
  background: linear-gradient(100deg, #2f6bff 0%, #6a4bff 55%, #2f6bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Subtle dotted / grid backgrounds ---- */
.bg-dots {
  background-image: radial-gradient(rgba(10, 10, 11, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
}
.bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
}

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.16, 0.84, 0.44, 1),
              transform 0.7s cubic-bezier(0.16, 0.84, 0.44, 1);
}
/* keep the GPU hint only while the entrance is still pending —
   dropped on .is-visible so revealed text is not stuck on a
   low-res composited layer (blurry text on high-DPR mobile) */
.reveal:not(.is-visible) { will-change: opacity, transform; }
.reveal.is-visible { opacity: 1; transform: none; will-change: auto; }
.reveal[data-delay="1"] { transition-delay: 0.07s; }
.reveal[data-delay="2"] { transition-delay: 0.14s; }
.reveal[data-delay="3"] { transition-delay: 0.21s; }
.reveal[data-delay="4"] { transition-delay: 0.28s; }
.reveal[data-delay="5"] { transition-delay: 0.35s; }
.reveal[data-delay="6"] { transition-delay: 0.42s; }

/* ---- Logo marquee ---- */
.marquee-mask {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee {
  display: flex;
  flex-wrap: nowrap;
  gap: 3.5rem;
  width: max-content;
  animation: marquee 40s linear infinite;
}
.marquee-mask:hover .marquee { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---- Hero orbit ---- */
.orbit {
  position: relative;
  width: 100%;
  max-width: 540px;
  margin-inline: auto;
  aspect-ratio: 1 / 1;
}
.orbit__ring {
  position: absolute;
  border-radius: 9999px;
  border: 1px dashed rgba(10, 10, 11, 0.14);
}
.orbit__ring--1 { inset: 2%; }
.orbit__ring--2 { inset: 19%; border-color: rgba(10, 10, 11, 0.10); }
.orbit__ring--3 { inset: 36%; border-color: rgba(47, 107, 255, 0.22); }
.orbit__ring--spin   { animation: spin 70s linear infinite; }
.orbit__ring--spin-r { animation: spin 95s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.orbit__lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.orbit__core {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 26%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  background: var(--ink);
  box-shadow: 0 24px 60px -18px rgba(10, 10, 11, 0.5);
}
.orbit__core::after {
  content: "";
  position: absolute;
  inset: -10%;
  border-radius: 9999px;
  border: 1px solid rgba(47, 107, 255, 0.35);
  animation: pulse-ring 3.6s ease-out infinite;
}
@keyframes pulse-ring {
  0%   { transform: scale(0.9); opacity: 0.7; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { opacity: 0; }
}

.orbit__node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 16%;
  min-width: 48px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #ecedf0;
  box-shadow: 0 14px 30px -14px rgba(10, 10, 11, 0.28);
  animation: float 7s ease-in-out infinite;
}
.orbit__node svg, .orbit__node img { width: 46%; height: 46%; }
.orbit__node:nth-child(odd)  { animation-duration: 8.5s; }
.orbit__node:nth-child(3n)   { animation-duration: 6.4s; animation-delay: -2s; }
.orbit__node:nth-child(4n)   { animation-delay: -3.5s; }
@keyframes float {
  0%, 100% { transform: translate(-50%, -50%); }
  50%      { transform: translate(-50%, calc(-50% - 12px)); }
}

/* ---- Card hover (no layout shift — color/shadow only) ---- */
.card-lift {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 50px -24px rgba(10, 10, 11, 0.32);
}

/* ---- Gallery thumbs ---- */
.tilt { transition: transform 0.4s cubic-bezier(0.16,0.84,0.44,1), box-shadow 0.4s ease; }
.tilt:hover { transform: translateY(-6px) scale(1.015); }

/* ---- Animated count-up holder ---- */
.stat-num { font-variant-numeric: tabular-nums; }

/* ---- Header scrolled state ---- */
.site-header {
  transition: background-color 0.3s ease, box-shadow 0.3s ease,
              backdrop-filter 0.3s ease, border-color 0.3s ease;
}
.site-header.is-scrolled {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-color: #ecedf0;
  box-shadow: 0 1px 0 rgba(10, 10, 11, 0.04);
}

/* ---- Mobile nav ----
   MUST be absolutely positioned: a collapsed nav left in normal flow
   still keeps its full height, making the fixed <header> ~470px tall.
   .is-scrolled then runs backdrop-blur + white bg over that whole box,
   smearing the entire hero on mobile. Absolute = header box is just
   the bar; the dropdown floats below it. */
.mobile-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
.mobile-nav[hidden] { display: block; }
.mobile-nav.is-closed {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
}

/* ---- Language toggle ---- */
.lang-btn { transition: color 0.2s ease, background-color 0.2s ease; }

/* ---- Logo on dark backgrounds (single-colour brand SVG -> white) ---- */
.logo-on-dark { filter: brightness(0) invert(1); }

/* ---- Legal document (privacy policy) ---- */
.legal-prose { color: #5b5b66; }
.legal-prose > :first-child { margin-top: 0; }
.legal-prose p { margin-top: 1rem; line-height: 1.75; }
.legal-prose h3 {
  margin-top: 1.9rem;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #0a0a0b;
}
.legal-prose h3 + p { margin-top: 0.5rem; }
.legal-prose ul { margin-top: 0.85rem; padding-left: 1.15rem; }
.legal-prose li { margin-top: 0.5rem; line-height: 1.7; list-style: disc; }
.legal-prose li::marker { color: #2f6bff; }
.legal-prose strong { color: #0a0a0b; font-weight: 600; }
.legal-prose a {
  color: #2f6bff;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}
.legal-prose a:hover { color: #1e4fd6; }

/* ---- Legal table of contents ---- */
.toc-link {
  display: block;
  border-left: 2px solid #ecedf0;
  padding: 0.32rem 0 0.32rem 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #5b5b66;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.toc-link:hover { color: #0a0a0b; border-color: #c9cad0; }

/* ---- Gallery lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(10, 10, 11, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: opacity 0.25s ease, visibility 0.25s;
}
.lightbox.is-closed { opacity: 0; visibility: hidden; pointer-events: none; }
.lightbox__panel {
  position: relative;
  width: 100%;
  max-width: min(560px, 92vw);
  overflow: hidden;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 40px 90px -25px rgba(0, 0, 0, 0.65);
  transition: transform 0.25s cubic-bezier(0.16, 0.84, 0.44, 1);
}
.lightbox.is-closed .lightbox__panel { transform: scale(0.94); }
.lightbox__panel img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 68vh;
  object-fit: contain;
  background: #f4f4f6;
}
.lightbox__caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid #ecedf0;
  padding: 1rem 1.25rem;
}
.lightbox__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: grid;
  place-items: center;
  height: 2.5rem;
  width: 2.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  transition: background-color 0.2s ease;
}
.lightbox__close:hover { background: rgba(255, 255, 255, 0.26); }

/* ---- Reduced motion: disable all decorative motion ---- */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  .marquee { animation: none; }
  .orbit__ring--spin, .orbit__ring--spin-r,
  .orbit__node, .orbit__core::after { animation: none !important; }
  .card-lift:hover, .tilt:hover { transform: none; }
  * { scroll-behavior: auto !important; }
}
