/*
 * Global stylesheet for the Nord Link redesign.
 * This file defines a warm colour palette, typography rules and responsive
 * layout helpers. It aims to provide a clean, modern look across all
 * pages while remaining lightweight and easy to maintain. Responsive
 * behaviour is achieved via fluid grid layouts and CSS media queries;
 * container queries could be added for more granular control if needed.
 */

/* CSS Custom Properties for theme colours and sizing */
:root {
  /* Brand colours */
  --primary-color: #b25718;
  /* burnt orange for highlights */
  --secondary-color: #f7a541;
  /* softer orange for hover states */
  --accent-color: #ee6c4d;
  /* coral accent used sparingly */
  --dark-color: #2f2923;
  /* dark brown for footers */
  --light-color: #f9f6f3;
  /* off‑white background */

  /* Typography */
  /* Modern system font stack for optimal performance and native look */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --heading-weight: 700;
  --body-weight: 400;
  --line-height: 1.6;

  /* Spacing */
  --section-padding: 4rem;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  color: #2e2e2e;
  background: var(--light-color);
  line-height: var(--line-height);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-color);
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

/* Container utility to centre content and control max‑width */
.container {
  width: 90%;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Navigation bar */
header {
  width: 100%;
  background: var(--light-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 999;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-weight: var(--heading-weight);
  font-size: 1.5rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo i {
  color: var(--primary-color);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

nav li {
  position: relative;
}

nav a {
  font-weight: 500;
  padding: 0.5rem;
}

nav a:hover::after,
nav a:focus::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--primary-color);
}

/* Mobile navigation toggle */
.nav-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Section styling */
section {
  padding: var(--section-padding) 0;
}

section.dark {
  background: var(--dark-color);
  color: #f2f2f2;
}

h1,
h2,
h3,
h4 {
  font-weight: var(--heading-weight);
  margin-bottom: 1rem;
  line-height: 1.3;
}

h1 {
  font-size: clamp(2rem, 5vw + 0.5rem, 3rem);
}

/* 
 * Explicitly set H1 font size in all contexts to avoid deprecated 
 * H1UserAgentFontSizeInSection API that affects Best Practices score 
 */
section h1,
article h1,
aside h1,
nav h1 {
  font-size: clamp(2rem, 5vw + 0.5rem, 3rem);
}


h2 {
  font-size: clamp(1.5rem, 4vw + 0.5rem, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw + 0.5rem, 2rem);
}

p {
  margin-bottom: 1rem;
  color: #4d4d4d;
}

/* Hero section */
.hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  overflow: hidden;
  /* Static gradient fallback until Vanta.js loads */
  background: linear-gradient(135deg, #2f2923 0%, #b25718 50%, #2f2923 100%);
}

.hero .content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  padding: 2rem;
  backdrop-filter: blur(3px) saturate(180%);
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
}

.hero .content h1 {
  margin-bottom: 0.75rem;
  color: #ffffff;
}

.hero .content p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: 2px solid var(--primary-color);
  background: var(--primary-color);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  background: transparent;
  color: var(--primary-color);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

/* Cards grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  padding: 2rem;
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

/* Animated border light - rotates around card */
.card::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 14px;
  background: linear-gradient(90deg,
      transparent,
      var(--card-glow-color, var(--primary-color)),
      transparent);
  opacity: 0;
  animation: borderSpin 3s linear infinite;
  pointer-events: none;
}

.card:hover::after {
  opacity: 0.5;
}

/* Card colors */
.services .card:nth-child(1) {
  --card-glow-color: #b25718;
}

.services .card:nth-child(1)::after {
  animation-delay: 0s;
}

.services .card:nth-child(2) {
  --card-glow-color: #4b84e5;
}

.services .card:nth-child(2)::after {
  animation-delay: 0.75s;
}

.services .card:nth-child(3) {
  --card-glow-color: #8ebc6b;
}

.services .card:nth-child(3)::after {
  animation-delay: 1.5s;
}

.services .card:nth-child(4) {
  --card-glow-color: #ee6c4d;
}

.services .card:nth-child(4)::after {
  animation-delay: 2.25s;
}

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

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

.card .icon {
  font-size: 2.5rem;
  color: var(--primary-color);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

.card p {
  flex-grow: 1;
}

.card .link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-top: auto;
}

.card .link i {
  transition: transform 0.2s ease;
}

.card .link:hover i {
  transform: translateX(3px);
}

/* Scroll reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Service detail grid used on inner pages */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3rem;
  align-items: center;
  margin-top: 2rem;
}

.service-grid .text {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.service-grid ul {
  list-style: none;
  padding-left: 0;
}

.service-grid li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.5rem;
}

.service-grid li::before {
  content: '\2022';
  color: var(--primary-color);
  font-weight: 700;
  position: absolute;
  left: 0;
}

/* Footer */
footer {
  background: var(--dark-color);
  color: white;
  padding: 3rem 0;
}

footer .footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

footer h4 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

footer ul {
  list-style: none;
  padding-left: 0;
}

footer li {
  margin-bottom: 0.5rem;
}

footer a {
  /* Increase contrast for footer links */
  color: #f0f0f0;
}

footer a:hover {
  color: var(--secondary-color);
}

footer .bottom {
  text-align: center;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1rem;
  /* WCAG AA compliant contrast ratio */
  color: rgba(255, 255, 255, 0.95);
}

/* Ensure footer paragraphs have sufficient contrast */
footer p {
  color: #ffffff;
}

/* Mobile breakpoint adjustments */
@media (max-width: 768px) {
  :root {
    --section-padding: 3rem;
  }

  nav ul {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 220px;
    background: var(--dark-color);
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    transition: right 0.3s ease;
    z-index: 1000;
    padding-left: 1rem;
  }

  nav ul.show {
    right: 0;
  }

  nav a {
    color: white;
    font-size: 1.1rem;
  }

  .nav-toggle {
    display: block;
    color: var(--primary-color);
  }

  /* hide underline on mobile nav */
  nav a:hover::after,
  nav a:focus::after {
    display: none;
  }

  .hero .content {
    padding: 1.5rem;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  footer .footer-grid {
    grid-template-columns: 1fr;
  }
}

/*
 * Visually hidden text for screen readers.  This utility helps provide
 * accessible labels on icon‑only links (e.g. social icons).  It hides
 * content off‑screen while keeping it available to assistive
 * technologies.
 */
.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;
}

/* Animated gradient background for hero sections (replaces Vanta.js) */
@keyframes gradient-shift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.hero-animated {
  background: linear-gradient(135deg,
      #2f2923 0%,
      #b25718 25%,
      #ee6c4d 50%,
      #b25718 75%,
      #2f2923 100%) !important;
  background-size: 300% 300%;
  animation: gradient-shift 15s ease infinite;
}