/* ==========================================================================
   globals.css — Ward Media Group
   Global design system: tokens, reset, layout, typography, utilities
   ========================================================================== */


/* === CSS VARIABLES ===
   ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */

:root {

  /* --- Surfaces --- */
  --void:          #080808;
  --carbon:        #111111;
  --graphite:      #1a1a1a;
  --iron:          #242424;
  --steel:         #2e2e2e;

  /* --- Silver Scale --- */
  --ash:           #555555;
  --slate:         #888888;
  --silver:        #aaaaaa;
  --pearl:         #e0e0e0;
  --white:         #f5f5f5;

  /* --- Accent --- */
  --blue:          #3a92ff;
  --blue-hover:    #5aaaff;
  --blue-glow:     rgba(58, 146, 255, 0.15);

  /* --- Glass --- */
  --glass-surface: rgba(255, 255, 255, 0.04);
  --glass-bg:      rgba(255, 255, 255, 0.04);
  --glass-border:  rgba(255, 255, 255, 0.08);
  --glass-blur:    blur(12px) saturate(150%);
  --overlay-dark:  rgba(8, 8, 8, 0.85);

  /* --- Radius --- */
  --radius-card:   24px;
  --radius-pill:   150px;

  /* --- Frame --- */
  --frame-size:    12px;

  /* --- Typography --- */
  --font:          'Poppins', sans-serif;

  /* --- Easing (matches skill: only transform + opacity on GPU layer) --- */
  --ease-smooth:   cubic-bezier(0.4, 0, 0.2, 1);   /* standard in/out */
  --ease-out:      cubic-bezier(0, 0, 0.2, 1);      /* elements entering */
  --ease-in-out:   cubic-bezier(0.4, 0, 0.6, 1);    /* mid-sequence */

  /* --- Timing --- */
  --fast:          200ms;   /* hover states */
  --mid:           400ms;   /* cards, reveals */
  --slow:          700ms;   /* section entrances */
}


/* === RESET & BASE ===
   ==========================================================================
   2. BASE RESET
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: auto; /* GSAP/Lenis handles smooth scroll */
  -webkit-text-size-adjust: 100%;
  background: #080808; /* dark base — white frame comes from #site-frame-overlay */
}

body {
  background: transparent;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
}

ul,
ol {
  list-style: none;
}

::selection {
  background: var(--blue);
  color: var(--white);
}

:focus-visible {
  outline: 1px solid var(--blue);
  outline-offset: 3px;
}


/* === FRAME SYSTEM ===
   ==========================================================================
   3. SITE LAYOUT — FRAME SYSTEM
   Background layers are fixed full-viewport. The white 20px frame is a
   box-shadow inset on #site-frame-overlay — not a wrapper element.
   Content scrolls normally in the browser window.
   ========================================================================== */

/* Background layers — fixed, fill full viewport, behind everything */
#bg-video,
#bg-grain,
#bg-vignette {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* White frame overlay.
   ::before  — flat white border, sharp outer corners flush to viewport.
   ::after   — sits at the inner edge; outward box-shadow fills the frame
               area while border-radius rounds only the inner corners. */
#site-frame-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
}

#site-frame-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  border: var(--frame-size) solid #ffffff;
  border-radius: 0;
  pointer-events: none;
}

#site-frame-overlay::after {
  content: '';
  position: absolute;
  inset: var(--frame-size);
  border-radius: var(--radius-card);
  box-shadow: 0 0 0 var(--frame-size) #ffffff;
  pointer-events: none;
}

/* Blue corner brackets — fixed, sits above the white overlay */
#site-frame {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
}

/* Page content — normal document flow, browser handles scroll */
#page-content {
  position: relative;
  z-index: 10;
  min-height: 100vh;
}


/* === TYPOGRAPHY ===
   ==========================================================================
   4. TYPOGRAPHY SCALE
   All sizes use clamp() — fluid between mobile and desktop breakpoints.
   ========================================================================== */

.text-hero {
  font-size: clamp(2.8rem, 8vw, 7rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--white);
}

.text-display {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--white);
}

.text-title {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--white);
}

.text-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--silver);
}

.text-body {
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  font-weight: 300;
  line-height: 1.75;
  color: var(--silver);
}

/* Small uppercase category label with blue rule */
.text-label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--blue);
}

.text-caption {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--ash);
}


/* === LAYOUT ===
   ==========================================================================
   5. SECTION UTILITIES
   ========================================================================== */

.section {
  position: relative;
  z-index: 10;
  padding: clamp(80px, 12vw, 140px) clamp(24px, 5vw, 80px);
}

.section-inner {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* Blue ruled label that precedes section headings */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--blue);
}

.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--blue);
  flex-shrink: 0;
}


/* === COMPONENTS ===
   ==========================================================================
   6. GLASS UTILITY
   backdrop-filter requires a non-opaque background to render correctly.
   ========================================================================== */

.glass {
  background: var(--glass-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

.glass-dark {
  background: rgba(8, 8, 8, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}


/* ==========================================================================
   7. SPLIT-PILL BUTTON — Ward Media Group
   Hover: blue fill expands from center to cover entire button
   ========================================================================== */

.btn-pill {
  height: 52px;
  padding: 0 32px;
  position: relative;
  background-color: transparent;
  cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.35);
  overflow: hidden;
  border-radius: 30px;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.5s ease-in-out;
  white-space: nowrap;
}

.btn-pill::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: all 0.5s ease-in-out;
  background-color: #ffffff;
  border-radius: 30px;
  height: 10px;
  width: 10px;
  z-index: 0;
}

.btn-pill:hover {
  box-shadow: 1px 1px 200px rgba(255,255,255,0.15);
  color: #111111;
  border-color: transparent;
}

.btn-pill:hover::after {
  transform: translate(-50%, -50%) scale(100);
}

.btn-pill-text {
  position: relative;
  z-index: 1;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  background: none;
  -webkit-text-fill-color: unset;
  padding: 0;
  white-space: nowrap;
}

.btn-pill-icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: inherit;
  transition: transform 0.3s ease;
}

.btn-pill:hover .btn-pill-icon {
  transform: translateX(3px);
}

/* Large variant */
.btn-pill-lg {
  height: 60px;
  padding: 0 40px;
  font-size: 0.875rem;
  gap: 14px;
}

/* Small variant */
.btn-pill-sm {
  height: 42px;
  padding: 0 24px;
  font-size: 0.6875rem;
  gap: 10px;
}


/* ==========================================================================
   8. CARD UTILITY
   Lift + border glow on hover — matches skill §5.1 card hover patterns.
   Transitions on transform + border-color only (GPU-safe per skill §19).
   ========================================================================== */

.card {
  background: var(--glass-surface);
  border: 1px solid var(--glass-border);
  border-radius: 2px;
  transition:
    border-color var(--mid) var(--ease-smooth),
    background var(--mid) var(--ease-smooth),
    transform var(--mid) var(--ease-smooth);
}

.card:hover {
  border-color: rgba(58, 146, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-4px);
}


/* ==========================================================================
   9. DIVIDER
   ========================================================================== */

.divider {
  width: 100%;
  height: 1px;
  background: var(--glass-border);
}


/* ==========================================================================
   10. GLOBAL SCROLLBAR
   Scoped to the document root; #page-content overrides with its own 3px bar.
   ========================================================================== */

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--void);
}

::-webkit-scrollbar-thumb {
  background: var(--steel);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--slate);
}


/* ==========================================================================
   10b. SCROLL TO TOP — fixed right side
   ========================================================================== */

#scroll-top {
  position: fixed;
  right: 32px;
  bottom: 40px;
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  transition: opacity 300ms ease,
              visibility 300ms ease,
              transform 300ms ease;
  transform: translateY(10px);
}

#scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#scroll-top:hover .scrolldown {
  border-color: var(--blue-hover);
}


/* === ANIMATIONS ===
   ==========================================================================
   11. REDUCED MOTION
   Collapses all animation/transition durations to near-zero.
   JS-driven GSAP animations should also check this via matchMedia.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* === RESPONSIVE ===
   ==========================================================================
   12. RTL PREPARATION
   ========================================================================== */

[dir="rtl"] .section-label {
  flex-direction: row-reverse;
  margin-inline-start: 0;
}

[dir="rtl"] .section-label::before {
  order: 1;
}

[dir="rtl"] .btn-pill {
  flex-direction: row-reverse;
}


/* === SECTIONS ===
   ==========================================================================
   SECTION 02 — CLIENTS TRUST STRIP
   ========================================================================== */

#clients {
  position: relative;
  z-index: 10;
  padding: 80px 0;
  background: rgba(8,8,8,0.3);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.clients-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.clients-label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #444444;
  text-align: center;
  margin-bottom: 8px;
}

.clients-marquee-wrapper {
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(
    to right,
    transparent,
    black 15%,
    black 85%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 15%,
    black 85%,
    transparent
  );
}

.clients-marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: marqueeScroll 30s linear infinite;
}

.clients-marquee-track:hover {
  animation-play-state: paused;
}

.client-name {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #888888;
  white-space: nowrap;
  transition: color 300ms ease;
}

.client-name:hover {
  color: #f5f5f5;
}

.marquee-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #3a92ff;
  flex-shrink: 0;
  margin: 0 32px;
}

@keyframes marqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
