/* ============================================================
   global.css — Base reset, typography, and utility classes
   ============================================================ */
/* Font: System-font stack defined in tokens.css — no external font requests */
@import 'tokens.css';

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

html {
  font-size: 17px;  /* Apple base: 17px */
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Offset for fixed header on anchor links */
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-base);
  color: var(--color-text-primary);
  background: var(--color-surface-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* clip not supported in older Safari */
}

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

a {
  color: var(--color-brand);
  text-decoration: none;
  transition: color var(--motion-fast) var(--motion-easing);
}
a:hover { color: var(--color-brand-light); }

ul, ol { list-style: none; }

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

input, textarea, select {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
}

/* ── Focus visible (WCAG 2.2 AA) ───────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ── Typography (design-premium.md) ─────────────────────── */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-primary);
  /* Default reset, specific overrides below */
}

/* Hero / big headline */
h1 { 
  font-size: var(--font-size-hero); 
  font-weight: var(--font-weight-semibold); 
  letter-spacing: -0.022em;
  line-height: 1.1; 
}
/* Section headline */
h2, .section-heading { 
  font-size: var(--font-size-h2); 
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.016em;
  line-height: 1.14;
}
/* Sub-headline */
h3, .section-subheading { 
  font-size: var(--font-size-h3); 
  font-weight: var(--font-weight-regular);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
/* H4, H5, H6 fallback */
h4 { font-size: 21px; font-weight: var(--font-weight-regular); letter-spacing: -0.01em; line-height: 1.25; }
h5 { font-size: 19px; font-weight: var(--font-weight-regular); letter-spacing: 0; line-height: 1.3; }
h6 { font-size: 17px; font-weight: var(--font-weight-semibold); letter-spacing: 0; line-height: 1.3; }

/* Body / paragraph */
p { 
  line-height: 1.45; 
  letter-spacing: -0.01em; 
  color: var(--color-text-secondary); 
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
}

.body-constrained {
  max-width: var(--body-max-width);
}

/* ── Layout Utilities ───────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-4); /* 24px each side */
}
@media (max-width: 768px) {
  .container { padding-inline: 16px; }
}

.section {
  padding-block: var(--space-6); /* 48px */
}
@media (max-width: 768px) {
  .section { padding-block: var(--space-4); /* 24px */ }
}

/* ── Section Labels ─────────────────────────────────────── */
.section-label {
  display: inline-block;
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
  letter-spacing: +0.012em; /* positive for tiny labels */
  line-height: 1.33;
  text-transform: uppercase;
  color: var(--color-text-secondary); /* Dropping bright brand color for labels based on strict rules */
  margin-bottom: var(--space-3);
}

.section-heading {
  margin-bottom: var(--space-4);
  /* Typography rules applied globally in h2 */
}
@media (max-width: 768px) {
  .section-heading { font-size: var(--font-size-h3); }
}

.section-subheading {
  color: var(--color-text-secondary);
  max-width: var(--body-max-width);
  margin-inline: auto;
  /* Typography rules applied globally in h3 */
}

/* ── Accent color on heading words ─────────────────────── */
.text-brand { color: var(--color-brand); }
.text-highlight {
  color: var(--color-brand);
}

.text-highlight-blue {
  color: #3399ff; /* Bright light blue for emphasis */
  text-shadow: 0 0 16px rgba(51,153,255,0.4);
}

/* ── Typography Utilities ────────────────────────────────── */
.text-muted  { color: var(--color-text-muted); }

/* ── Grid utilities ─────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Flex utilities ─────────────────────────────────────── */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-col    { display: flex; flex-direction: column; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }

/* ── Divider ────────────────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  margin-block: var(--space-6);
}

/* ── Empty State ────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-5);
  text-align: center;
  gap: var(--space-4);
}
.empty-state__icon {
  font-size: 48px;
  opacity: 0.3;
}
.empty-state__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
}
.empty-state__text {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
  max-width: 40ch;
}

/* ── Skeleton loader ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* Floating WhatsApp Button */
.fab-whatsapp {
  position: fixed;
  bottom: 32px;
  right: 32px;
  height: 60px;
  padding: 0 24px 0 20px;
  background-color: #25D366;
  color: white;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 9999;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: transform var(--motion-fast) var(--motion-easing), box-shadow var(--motion-fast) var(--motion-easing), background-color var(--motion-fast) var(--motion-easing);
}

.fab-whatsapp:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 16px rgba(37,211,102,0.4);
  background-color: #1ebe57;
  color: white;
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Visually hidden (a11y) ─────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Scrollbar styling ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-surface-base); }
::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--color-brand-muted); }

/* ════════════════════════════════════════════════════════════
   SCROLL REVEAL ANIMATIONS (Vertora-inspired)
   ════════════════════════════════════════════════════════════ */

/* Default: fade up */
[data-reveal] {
  opacity: 0;
  transform: translateY(48px);
  filter: blur(5px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Fade from left */
[data-reveal="fade-left"] {
  opacity: 0;
  transform: translateX(-40px);
  filter: blur(5px);
}
[data-reveal="fade-left"].revealed {
  opacity: 1;
  transform: translateX(0);
  filter: blur(0);
}

/* Fade from right */
[data-reveal="fade-right"] {
  opacity: 0;
  transform: translateX(40px);
  filter: blur(5px);
}
[data-reveal="fade-right"].revealed {
  opacity: 1;
  transform: translateX(0);
  filter: blur(0);
}

/* Scale up */
[data-reveal="scale"] {
  opacity: 0;
  transform: scale(0.88);
  filter: blur(5px);
}
[data-reveal="scale"].revealed {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

/* Expanding line */
[data-reveal="line"] {
  width: 0 !important;
  transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal="line"].revealed {
  width: 100% !important;
}

/* ── Scroll Progress Bar ──────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #2997ff, #00c5ff);
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(41, 151, 255, 0.6);
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════
   PAGE LOADER — Lenstalk branded intro screen
   ══════════════════════════════════════════════════════════ */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #050608;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 32px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#page-loader.loader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.loader-logo {
  width: 160px;
  height: auto;
  animation: loaderPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(41, 151, 255, 0.4));
}

@keyframes loaderPulse {
  0%, 100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 20px rgba(41, 151, 255, 0.35)); }
  50%       { opacity: 0.85; transform: scale(1.04); filter: drop-shadow(0 0 36px rgba(41, 151, 255, 0.6)); }
}

.loader-bar-track {
  width: 200px;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2997ff, #00c5ff);
  border-radius: 99px;
  box-shadow: 0 0 10px rgba(41, 151, 255, 0.7);
  animation: loaderBarFill 1.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes loaderBarFill {
  0%   { width: 0%; }
  60%  { width: 75%; }
  85%  { width: 90%; }
  100% { width: 100%; }
}

/* ── Reduce motion for accessibility ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
  .loader-logo { animation: none; }
  .loader-bar-fill { animation: none; width: 100%; }
}

