/* =============================================================================
   common.css — EireID Design System
   Base reset, CSS variables, global styles, and reusable brand utilities.
   All page-specific or component-specific styles live in their own files.
   ============================================================================= */

/* ─── 1. CSS Custom Properties (Design Tokens) ───────────────────────────── */
:root {

  /* --- Colors --- */
  --color-bg-primary: #a4e5b7;
  --color-text-heading: #000000;
  --color-text-body: #1a1a1a;
  --color-text-muted: #333333;
  --color-border: #000000;
  --color-btn-primary: #000000;
  --color-btn-hover: #1a1a1a;

  /* --- Typography --- */
  --font-family-base: 'Lato', sans-serif;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 3rem;
  --font-size-hero: clamp(2rem, 3.5vw, 3.25rem);

  /* --- Spacing --- */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-section: clamp(3rem, 8vw, 6rem);

  /* --- Layout --- */
  --container-max: 1280px;
  --container-padding: clamp(1rem, 5vw, 2rem);

  /* --- Border Radius --- */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.16);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.20);

  /* --- Transitions --- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* ─── 2. Reset ────────────────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
}

/* ─── 3. Base Body ────────────────────────────────────────────────────────── */

body {
  font-family: var(--font-family-base);
  color: var(--color-text-body);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  background-color: #e3f7e8;
  scroll-behavior: smooth;
}

body::after {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 20%, #effaee 0%, transparent 55%),
    radial-gradient(circle at 85% 85%, #bcebc7 0%, transparent 65%),
    radial-gradient(circle at 95% 15%, #9fdcae 0%, transparent 60%),
    radial-gradient(circle at 20% 90%, #d1f4da 0%, transparent 60%),
    #e3f7e8;
  animation: gradientShift 20s ease-in-out infinite alternate;
  will-change: transform;
}

body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: -20%;
  width: 140vw;
  height: 140vh;
  background-image: url('../assets/logo/harp_black.svg');
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.02;
  transform: rotate(-10deg);
  pointer-events: none;
  z-index: -1;
}

/* ─── 4. Layout Utility ───────────────────────────────────────────────────── */

#scroll-wrapper {
  width: 100%;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) var(--container-padding);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.container--fullwidth {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ─── 5. Brand Utility Classes ────────────────────────────────────────────── */

/**
 * .logo-box
 * Square card used for logo containers, icon tiles, and interactive badges.
 * Sizes are set contextually (80px default on mobile, override as needed).
 *
 * Usage:
 *   <button class="logo-box logo-box--glass"> … </button>
 */
.logo-box {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base);
  cursor: pointer;
}

.logo-box:nth-child(1) {
  animation: float 4s ease-in-out infinite;
}

.logo-box:nth-child(2) {
  animation: float 4s ease-in-out infinite 2s;
}

.logo-box:hover,
.logo-box:focus-visible {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-hover);
}

.logo-box:focus-visible {
  outline: 3px solid white;
  outline-offset: 4px;
}

.logo-box--glass {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.10);
  backdrop-filter: blur(2.9px);
  -webkit-backdrop-filter: blur(2.9px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.logo-box__svg {
  width: 100%;
  height: 100%;
}

.pulse-animation {
  animation: pulseLogo 4s infinite ease-in-out;
}

/* ─── 6. Keyframe Animations ──────────────────────────────────────────────── */

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes translateYFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes gradientShift {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(2%, 2%) rotate(1deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes scrollWheel {
  0% {
    transform: translateY(0);
    opacity: 1;
  }

  50% {
    transform: translateY(5px);
    opacity: 0;
  }

  51% {
    transform: translateY(-3px);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes orbitRotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes orbitCounterRotate {
  from {
    transform: rotate(var(--angle)) translateY(-90px) rotate(calc(var(--angle) * -1)) rotate(0deg);
  }

  to {
    transform: rotate(var(--angle)) translateY(-90px) rotate(calc(var(--angle) * -1)) rotate(-360deg);
  }
}

@keyframes pulseLogo {
  0% {
    box-shadow: 0 0 0 0px rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%) scale(1);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
    transform: translate(-50%, -50%) scale(1.05);
  }

  100% {
    box-shadow: 0 0 0 0px rgba(255, 255, 255, 0);
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ─── 7. Buttons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--font-size-base);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  font-family: var(--font-family-base);
}

.btn--primary {
  background-color: var(--color-bg-primary);
  color: var(--color-text-heading);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background-color: var(--color-text-heading);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--branded {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-heading);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  z-index: 1;
  padding: 0 var(--space-xl);
  height: 48px;
}

.btn--branded::after {
  content: '';
  position: absolute;
  bottom: 12px;
  left: 30%;
  width: 40%;
  height: 1px;
  background-color: var(--color-text-heading);
  transform: scaleX(0) translateZ(0);
  transform-origin: center;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
  z-index: 5;
}

.btn--branded:hover::after,
.btn--branded:focus-visible::after {
  transform: scaleX(1) translateZ(0);
}

.btn--branded::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: -1;
  pointer-events: none;
}

.btn--branded:hover::before,
.btn--branded:focus-visible::before {
  background: rgba(255, 255, 255, 0.25);
  transform: translate(-50%, -50%) scale(1.02);
}

.btn--branded:active::before {
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.1s ease;
  transform: translate(-50%, -50%) scale(0.98);
}

/* ─── 8. Reveal Animations (Standardized) ─────────────────────────────────── */

[data-reveal], 
.timeline-step__text h4, 
.timeline-step__text p {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: opacity, transform;
}

[data-reveal].is-revealed, 
.is-active .timeline-step__text h4, 
.is-active .timeline-step__text p {
  opacity: 1;
  transform: translateY(0);
}

.is-active .timeline-step__text h4 {
  transition-delay: 0.1s;
}

.is-active .timeline-step__text p {
  transition-delay: 0.2s;
}

/* ─── 9. Preloader & Loading Animation ───────────────────────────────────── */

.preloader {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100000;
  background:
    radial-gradient(circle at 10% 20%, #effaee 0%, transparent 55%),
    radial-gradient(circle at 85% 85%, #bcebc7 0%, transparent 65%),
    radial-gradient(circle at 95% 15%, #9fdcae 0%, transparent 60%),
    radial-gradient(circle at 20% 90%, #d1f4da 0%, transparent 60%),
    #e3f7e8;
  transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), 
              visibility 1.2s cubic-bezier(0.22, 1, 0.36, 1),
              transform 1.2s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.8s ease;
  pointer-events: all;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.05);
  filter: blur(10px);
  pointer-events: none;
}

.loader {
  width: 140px;
  height: 140px;
  background-color: #1b4d3e;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 30px 4px rgba(0, 0, 0, 0.5) inset, 0 5px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  backdrop-filter: blur(4px);
}

.loader:before,
.loader:after {
  content: "";
  position: absolute;
  width: 200%;
  height: 200%;
  border-radius: 45%;
  top: -155%;
  left: -50%;
  background-color: #a4e5b7;
  animation: wave 5s linear infinite;
  transition: top 1s ease;
}

.loader:before {
  border-radius: 30%;
  background: rgba(255, 255, 255, 0.25);
  top: -160%;
  animation: wave 7s linear infinite;
}

@keyframes wave {
  0% { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}

/* ─── 10. Accessibility Utilities ────────────────────────────────────────── */

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--container-padding);
  background: var(--color-bg-primary);
  color: var(--color-text-heading);
  padding: var(--space-sm) var(--space-md);
  z-index: 100000;
  text-decoration: none;
  font-weight: 700;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: top var(--transition-base);
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--color-text-heading);
  outline-offset: 2px;
}

