/* ==========================================================================
   APEX MEDIA — GLOBAL STYLESHEET
   Design tokens, reset, typography, buttons, shared utilities & animations.
   Loaded on every page, before header.css / footer.css / page-specific CSS.
   ========================================================================== */

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

:root {
  /* Core palette (kept from the original brand direction) */
  --background: #0e1017;
  --background-soft: #12141d;
  --surface: #171a24;
  --surface-deep: #0a0b10;
  --card: #191c27;

  --foreground: #f2f4f8;
  --muted-foreground: #a7b0c2;
  --steel: #b0c4de;
  --steel-soft: #cbd7e8;
  --primary: #a9c2e0;
  --primary-foreground: #0c0e14;

  --border: rgba(176, 196, 222, 0.14);
  --border-strong: rgba(176, 196, 222, 0.34);

  --success: #7fc8a9;
  --warning: #e0c27f;
  --danger: #e08f7f;

  --radius-sm: 0.2rem;
  --radius: 0.35rem;
  --radius-lg: 0.75rem;

  --font-sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;

  --header-h: 5rem;
  --ease-smooth: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow-soft: 0 20px 60px -20px rgba(0,0,0,0.6);
  --shadow-lift: 0 30px 80px -24px rgba(10,14,22,0.7);

  --max-width: 1800px;
}

html {
  scroll-behavior: smooth;
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: var(--header-h);
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  overflow-x: clip;
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

::selection { background: var(--primary); color: var(--primary-foreground); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { list-style: none; }
input, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

/* ── Layout Utilities ── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
@media (min-width: 640px)  { .container { padding-left: 2rem; padding-right: 2rem; } }
@media (min-width: 1024px) { .container { padding-left: 3rem; padding-right: 3rem; } }

.container-narrow { max-width: 68rem; }

.section-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--primary);
}
.section-label::before {
  content: "";
  display: block;
  width: 2rem;
  height: 1px;
  background: var(--primary);
  flex-shrink: 0;
}

.eyebrow { color: var(--primary); font-weight: 700; }
.accent { color: var(--primary); }
.text-balance { text-wrap: balance; }
.text-muted { color: var(--muted-foreground); }

.grid-2 { display: grid; gap: 2rem; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.grid-3 { display: grid; gap: 1.75rem; }
@media (min-width: 720px)  { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .grid-3 { grid-template-columns: 1fr 1fr 1fr; } }

.section {
  padding: 5rem 0;
}
@media (min-width: 1024px) { .section { padding: 8rem 0; } }
.section-tight { padding: 3.5rem 0; }
.section-bordered { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-surface { background: var(--surface); }

/* ── Page hero (used by every interior page) ── */
.page-hero {
  position: relative;
  padding: 10rem 0 4rem;
  background: var(--surface-deep);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(176,196,222,0.06) 1px, transparent 1px);
  background-size: 6.25% 100%;
  opacity: 0.5;
  pointer-events: none;
}
.page-hero .crumbs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.page-hero .crumbs a:hover { color: var(--primary); }
.page-hero .crumbs .sep { color: var(--border-strong); }
.page-hero .crumbs .current { color: var(--primary); }
.page-hero h1 {
  position: relative;
  font-size: clamp(2.6rem, 6.5vw, 5.5rem);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.92;
  max-width: 56rem;
}
.page-hero .lede {
  position: relative;
  margin-top: 1.5rem;
  max-width: 42rem;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--muted-foreground);
}
@media (min-width: 640px) { .page-hero .lede { font-size: 1.1rem; } }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 2rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: transform 0.35s var(--ease-smooth), background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
  box-shadow: 0 8px 24px -8px rgba(169,194,224,0.45);
}
.btn-primary:hover { background: #c3d6ec; border-color: #c3d6ec; box-shadow: 0 14px 32px -10px rgba(169,194,224,0.6); }

.btn-outline {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border-strong);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(176,196,222,0.06); }

.btn-outline-light {
  background: transparent;
  color: var(--primary-foreground);
  border-color: var(--primary-foreground);
}
.btn-outline-light:hover { background: var(--primary-foreground); color: var(--primary); }

.btn-ghost {
  background: transparent;
  color: var(--foreground);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
  min-height: auto;
}
.btn-ghost:hover { color: var(--primary); transform: translateX(4px); }

.btn-block { width: 100%; }
.btn-sm { min-height: 2.5rem; padding: 0.5rem 1.25rem; font-size: 0.62rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; }

/* Arrow link (used throughout) */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--foreground);
  transition: color 0.3s ease, gap 0.3s ease;
}
.arrow-link .arrow { color: var(--primary); transition: transform 0.3s var(--ease-smooth); display: inline-block; }
.arrow-link:hover { color: var(--primary); gap: 0.9rem; }
.arrow-link:hover .arrow { transform: translate(3px, -3px); }

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: transform 0.4s var(--ease-smooth), border-color 0.35s ease, box-shadow 0.35s ease;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}

/* ── Stats strip ── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (min-width: 800px) { .stats-strip { grid-template-columns: repeat(4, 1fr); } }
.stats-strip .stat {
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease;
}
.stats-strip .stat:hover { background: var(--surface); }
@media (min-width: 800px) { .stats-strip .stat:nth-child(4) { border-right: none; } .stats-strip .stat { border-bottom: none; } }
.stats-strip .stat .figure {
  display: block;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stats-strip .stat .caption {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
}

/* ── Numbered process steps ── */
.process-list { border-top: 1px solid var(--border); }
.process-step {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left 0.35s var(--ease-smooth);
}
.process-step:hover { padding-left: 0.75rem; }
@media (min-width: 720px) { .process-step { grid-template-columns: 5rem 1fr auto; align-items: center; gap: 2rem; } }
.process-step .num { font-size: 1.1rem; font-weight: 800; color: var(--primary); }
.process-step h3 { font-size: 1.15rem; text-transform: uppercase; margin-bottom: 0.5rem; letter-spacing: 0.02em; }
.process-step p { color: var(--muted-foreground); font-size: 0.9rem; line-height: 1.65; max-width: 40rem; }

/* ── Forms ── */
.form-field { display: grid; gap: 0.5rem; margin-bottom: 1.5rem; }
.form-field label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  color: var(--foreground);
  transition: border-color 0.3s ease, background 0.3s ease;
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: rgba(167,176,194,0.55); }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card);
}
.form-row { display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .form-row.cols-2 { grid-template-columns: 1fr 1fr; } }
.form-note { font-size: 0.75rem; color: var(--muted-foreground); margin-top: 0.5rem; }
.form-status {
  display: none;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}
.form-status.show { display: block; }
.form-status.success { border-color: var(--success); color: var(--success); }
.form-status.error { border-color: var(--danger); color: var(--danger); }

/* ── Reveal-on-scroll animation ──
   Progressive enhancement: content is visible by default. Only once the
   inline head-script confirms JS is running (html.js) do we hide .reveal
   elements pending their entrance animation — so a JS failure never
   leaves real content invisible. */
.reveal { opacity: 1; transform: none; }
html.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-smooth), transform 0.8s var(--ease-smooth);
}
html.js .reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ── Image placeholder (until real photography is uploaded) ── */
.img-ph {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(176,196,222,0.10), rgba(176,196,222,0.02)),
    repeating-linear-gradient(45deg, rgba(176,196,222,0.06) 0 2px, transparent 2px 14px);
  border: 1px dashed var(--border-strong);
  color: var(--muted-foreground);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  line-height: 1.6;
  padding: 1.5rem;
  min-height: 220px;
  width: 100%;
  height: 100%;
}
.img-ph .ph-label {
  max-width: 22rem;
}
.img-ph .ph-label b { display: block; color: var(--steel-soft); font-size: 0.78rem; margin-bottom: 0.35rem; text-transform: none; letter-spacing: 0; }

/* ── WhatsApp Floating Button ── */
.whatsapp-float {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #25D366;
  color: #0b1a10;
  border-radius: 999px;
  padding: 0.85rem;
  box-shadow: 0 12px 32px -8px rgba(37,211,102,0.55);
  transition: transform 0.35s var(--ease-smooth), padding 0.35s var(--ease-smooth), box-shadow 0.35s ease;
}
.whatsapp-float:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 18px 40px -8px rgba(37,211,102,0.7);
}
.whatsapp-float svg { width: 1.85rem; height: 1.85rem; flex-shrink: 0; }
.whatsapp-float .wa-label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 700;
  transition: max-width 0.4s var(--ease-smooth), margin 0.4s ease;
}
.whatsapp-float:hover .wa-label,
.whatsapp-float:focus-visible .wa-label { max-width: 10rem; margin-right: 0.25rem; }
@media (max-width: 640px) {
  .whatsapp-float { right: 1rem; bottom: 1rem; padding: 0.8rem; }
  .whatsapp-float .wa-label { display: none; }
}
.whatsapp-float .wa-pulse {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #25D366;
  opacity: 0.6;
  animation: wa-pulse 2.4s ease-out infinite;
  z-index: -1;
}
@keyframes wa-pulse {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* ── Back to top ── */
.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 5.5rem;
  z-index: 89;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border-strong);
  color: var(--primary);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
}
.back-to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: var(--primary); color: var(--primary-foreground); }
@media (max-width: 640px) { .back-to-top { right: 1rem; bottom: 4.75rem; width: 2.4rem; height: 2.4rem; } }

/* ── Cookie Consent Banner ── */
.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 95;
  max-width: 46rem;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lift);
  transform: translateY(140%);
  opacity: 0;
  transition: transform 0.5s var(--ease-smooth), opacity 0.5s ease;
}
.cookie-banner.show { transform: translateY(0); opacity: 1; }
.cookie-banner p { font-size: 0.85rem; line-height: 1.6; color: var(--muted-foreground); margin-bottom: 1.25rem; }
.cookie-banner p a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.cookie-banner .cookie-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ── Scroll-triggered progress bar (used in header.css but token lives here) ── */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 999;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  transition: top 0.25s ease;
}
.skip-link:focus { top: 1rem; }

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

/* ── Hover-move micro-interaction helpers (used across pages) ── */
.hover-lift { transition: transform 0.35s var(--ease-smooth); }
.hover-lift:hover { transform: translateY(-6px); }
.hover-shift { transition: transform 0.3s var(--ease-smooth); }
.hover-shift:hover { transform: translateX(6px); }
.hover-zoom-wrap { overflow: hidden; }
.hover-zoom-wrap img { transition: transform 0.6s var(--ease-smooth); }
.hover-zoom-wrap:hover img { transform: scale(1.06); }

