/* ============================================
   SQUAREdog Consulting — Global Styles
   Tailwind CSS v3 (CDN) + Custom Styles
   ============================================ */

/* ---- Tailwind Directives (processed by CDN) ---- */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* ============================================
   Google Fonts Import
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================
   CSS Custom Properties — Design Tokens
   ============================================ */
:root {
  /* Colours */
  --color-primary: #0f172a;
  --color-accent: #0d9488;
  --color-accent-hover: #0f766e;
  --color-bg: #fafaf9;
  --color-surface: #ffffff;
  --color-surface-alt: #f5f5f4;
  --color-text-primary: #1c1917;
  --color-text-secondary: #78716c;
  --color-border: #e7e5e4;
  --color-star-gold: #f59e0b;

  /* Footer */
  --color-footer-text: #a8a29e;
  --color-footer-divider: #334155;

  /* Shadows */
  --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-nav: 0 1px 3px rgba(0,0,0,0.06);

  /* Spacing */
  --section-padding: 96px;
  --section-padding-mobile: 64px;
  --content-max-width: 1200px;
  --container-padding: 24px;
  --card-gap: 32px;
  --component-gap: 16px;

  /* Border Radius */
  --radius-card: 12px;
  --radius-button: 8px;
  --radius-image: 8px;
  --radius-badge: 9999px;
}

/* ============================================
   Base Styles
   ============================================ */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Lock body scroll when mobile nav is open */
body.nav-open {
  overflow: hidden;
}

/* ============================================
   Scroll Reveal Animations
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children within a reveal container */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 100ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 200ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 300ms; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 400ms; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 500ms; }

/* ============================================
   Section Layout Utilities
   ============================================ */
.section-padding {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
}

.container-main {
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* ============================================
   Card Styles
   ============================================ */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: box-shadow 300ms ease, transform 300ms ease;
}

.card-hover:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}

/* ============================================
   Eyebrow Text
   ============================================ */
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
}

/* ============================================
   Nav Link Hover Animation
   ============================================ */
.nav-link {
  position: relative;
  color: var(--color-text-secondary);
  font-size: 15px;
  font-weight: 500;
  transition: color 200ms ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease;
}

.nav-link:hover {
  color: var(--color-accent);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-link.active {
  color: var(--color-accent);
}

.nav-link.active::after {
  transform: scaleX(1);
}

/* ============================================
   Mobile Navigation Overlay
   ============================================ */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(15, 23, 42, 0.98);
  transform: translateX(100%);
  transition: transform 300ms ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

body.nav-open .mobile-nav-overlay {
  transform: translateX(0);
}

.mobile-nav-link {
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  padding: 16px 0;
  transition: color 200ms ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--color-accent);
}

/* Hamburger → X animation */
.hamburger .line {
  transition: transform 300ms ease, opacity 300ms ease;
  transform-origin: center;
}

body.nav-open .hamburger .line-1 {
  transform: translateY(7px) rotate(45deg);
}

body.nav-open .hamburger .line-2 {
  opacity: 0;
}

body.nav-open .hamburger .line-3 {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   Scroll Indicator (Hero)
   ============================================ */
.scroll-indicator {
  animation: bounce 1.5s ease infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8px);
  }
}

.scroll-indicator.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

/* ============================================
   Float Animation (Hero Image)
   ============================================ */
.float-animation {
  animation: float 4s ease-in-out infinite alternate;
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-8px);
  }
}

/* ============================================
   Star Rating — Filled Stars
   ============================================ */
.star-filled {
  color: var(--color-star-gold);
  fill: var(--color-star-gold);
}

/* ============================================
   Button Styles
   ============================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius-button);
  transition: background-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-hover);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: var(--color-accent);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 28px;
  border: 1.5px solid var(--color-accent);
  border-radius: var(--radius-button);
  transition: background-color 200ms ease, color 200ms ease;
}

.btn-secondary:hover {
  background-color: var(--color-accent);
  color: #ffffff;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  color: var(--color-accent);
  font-size: 15px;
  font-weight: 600;
  transition: text-decoration 200ms ease;
}

.btn-ghost:hover {
  text-decoration: underline;
}

/* ============================================
   Footer Link Styles
   ============================================ */
.footer-link {
  color: var(--color-footer-text);
  transition: color 200ms ease;
}

.footer-link:hover {
  color: #ffffff;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
  .section-padding {
    padding-top: var(--section-padding-mobile);
    padding-bottom: var(--section-padding-mobile);
  }
}

/* ============================================
   Filter Buttons (Projects Page)
   ============================================ */
.filter-btn {
  background-color: var(--color-surface-alt);
  color: var(--color-text-secondary);
  border: none;
  cursor: pointer;
  transition: background-color 200ms ease, box-shadow 200ms ease, color 200ms ease;
}

.filter-btn:hover {
  background-color: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.filter-btn.active {
  background-color: var(--color-accent);
  color: #ffffff;
}

/* ============================================
   Project Card Hidden State (Filtering)
   ============================================ */
.project-card.hidden {
  display: none;
}

/* ============================================
   Lightbox Styles
   ============================================ */
#lightbox {
  /* Base styles set inline in JS; transitions handled there */
}

#lightbox-close:hover {
  opacity: 0.7;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .no-print {
    display: none !important;
  }
  html {
    scroll-behavior: auto;
  }
}
