:root {
  --brand-primary: #0D47A1; /* Deep, trustworthy blue */
  --brand-secondary: #1976D2; /* A slightly lighter, energetic blue */
  --brand-accent: #FFC107; /* A warm, contrasting amber for highlights */
  --neutral-900: #1a202c; /* Very dark gray for primary text */
  --neutral-700: #4a5568; /* Medium gray for secondary text */
  --neutral-300: #e2e8f0; /* Light gray for borders */
  --neutral-100: #f7fafc; /* Off-white for backgrounds */
  --neutral-0: #ffffff; /* Pure white */
  --max-width: 1120px;
  --transition-speed: 200ms;
  --border-radius-md: 12px;
  --border-radius-lg: 24px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch; /* Momentum-based scrolling on iOS */
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--neutral-900);
  background-color: var(--neutral-100);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

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

a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 2px solid var(--aelion-blue-400);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  background: var(--accent-600);
  color: var(--aelion-white);
  padding: 8px 14px;
  border-radius: 999px;
  z-index: 100;
  font-weight: 600;
}

.skip-link:focus {
  left: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(247, 250, 252, 0.85);
  border-bottom: 1px solid var(--neutral-300);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  padding: 16px min(5vw, 40px);
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.header-nav {
  display: flex;
  align-items: center;
  flex: 1;
}

.nav-left {
  justify-content: flex-end;
}

.nav-right {
  justify-content: flex-start;
}

.site-header .header-nav a {
  margin: 0 16px;
  text-decoration: none;
  color: var(--neutral-700);
  font-weight: 600;
  letter-spacing: 0.01em;
  position: relative;
  transition: color var(--transition-speed) ease;
}

.site-header .header-nav a:hover,
.site-header .header-nav a:focus {
  color: var(--brand-primary);
}

.site-header .header-nav a::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--brand-primary);
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

.site-header .header-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.logo {
  display: flex;
  align-items: center;
  line-height: 1;
  transition: opacity var(--transition-speed) ease;
  flex-shrink: 0; /* Prevent logo from shrinking */
}

.logo img {
  max-height: 90px; /* Further increased size */
  width: auto;
}

.site-header .logo:hover {
  opacity: 0.8;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.section {
  padding: clamp(32px, 5vw, 60px) min(5vw, 40px);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  border-bottom: 1px solid var(--neutral-300);
}

.section.visible {
  opacity: 1;
  transform: none;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
}

.section-heading p,
.section-intro {
  color: var(--neutral-700);
  margin: 0 0 32px;
  max-width: 680px;
  font-size: 1.1rem;
}

h1, h2 {
  font-family: 'Michroma', 'Exo 2', 'Inter', sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--neutral-900);
}

h1 {
  font-size: clamp(32px, 5vw, 52px);
  margin: 0 0 16px;
}

h2 {
  font-size: clamp(26px, 4vw, 38px);
  margin: 0 0 24px;
}

h3 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.2rem;
  margin: 0 0 8px;
  color: var(--neutral-900);
}

p {
  margin: 0 0 16px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  max-width: 520px;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  font-weight: 700;
  color: var(--brand-secondary);
  margin: 0;
}

.hero-typing {
  font-size: 1.15rem;
  color: var(--neutral-700);
  min-height: 1.6em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-visual {
  position: relative;
  min-height: 360px;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, var(--neutral-0), var(--neutral-100));
  border: 1px solid var(--neutral-300);
  box-shadow: var(--shadow-lg);
}

.hero-visual video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  opacity: 0.1;
}

.hero-grid .grid-line {
  display: block;
  background: linear-gradient(180deg, transparent, var(--neutral-300), transparent);
}

.hero-orbit {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 2px dashed var(--neutral-300);
  filter: drop-shadow(0 12px 30px rgba(203, 213, 225, 0.5));
  animation: spin 20s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-card {
  position: absolute;
  bottom: 26px;
  right: 26px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--neutral-300);
  border-radius: var(--border-radius-md);
  padding: 18px 22px;
  color: var(--neutral-900);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  max-width: 220px;
  box-shadow: var(--shadow-md);
}

.hero-card p {
  margin: 0;
  font-size: 0.95rem;
}

.hero-card-sub {
  font-size: 0.8rem;
  color: var(--neutral-700);
  margin-top: 6px;
}

.hero-card-meta {
  font-size: 0.75rem;
  margin-top: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--neutral-700);
}

#hero {
  position: relative;
  color: var(--neutral-900);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: center;
  gap: clamp(32px, 6vw, 64px);
  border-radius: var(--border-radius-lg);
  margin-top: clamp(16px, 3vw, 40px);
  border: 1px solid var(--neutral-300);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  padding: clamp(64px, 10vw, 120px) min(5vw, 40px);
}

#hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 1;
}

#hero .hero-visual {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#hero .hero-copy {
  position: relative;
  z-index: 2;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.btn.primary {
  background-color: var(--brand-primary);
  color: var(--neutral-0);
  box-shadow: var(--shadow-md);
}

.btn.primary:hover,
.btn.primary:focus {
  background-color: var(--brand-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn.outline {
  color: var(--brand-primary);
  border-color: var(--neutral-300);
  background-color: var(--neutral-0);
  box-shadow: var(--shadow-sm);
}

.btn.outline:hover,
.btn.outline:focus {
  background-color: var(--neutral-100);
  border-color: var(--brand-secondary);
  color: var(--brand-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.services li {
  background: var(--neutral-0);
  border: 1px solid var(--neutral-300);
  border-radius: var(--border-radius-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, border-color var(--transition-speed) ease;
  box-shadow: var(--shadow-sm);
}

.services li:hover,
.services li:focus-within {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-secondary);
}

.grid-container {
  position: relative;
}

.grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 20px;
  overflow-x: hidden;
  padding: 20px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* Internet Explorer 10+ */
  scroll-behavior: smooth;
}

.grid::-webkit-scrollbar { /* WebKit */
  width: 0;
  height: 0;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--neutral-300);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.nav-arrow:hover {
  background-color: var(--neutral-0);
  box-shadow: var(--shadow-md);
}

.left-arrow {
  left: 0px;
}

.right-arrow {
  right: 0px;
}

.hidden-project {
  display: none;
}

.cat {
  margin-top: 16px;
}

.cat h3 {
  font-family: 'Michroma', 'Exo 2', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.9rem;
  color: var(--neutral-700);
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--neutral-300);
}

.projects-loading,
.projects-fallback,
.projects-empty,
.projects-error {
  margin-top: 18px;
  padding: 16px 20px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  border: 1px solid var(--neutral-300);
  background: var(--neutral-100);
  color: var(--neutral-900);
}

.projects-empty {
  background: var(--neutral-0);
  border-color: var(--neutral-300);
  color: var(--neutral-700);
  font-weight: 500;
}

.projects-fallback {
  font-style: italic;
}

.projects-error {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(220, 38, 38, 0.2);
  color: #b91c1c;
}

.project-card {
  border: 1px solid var(--neutral-300);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  background: var(--neutral-0);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, border-color var(--transition-speed) ease;
  height: 280px;
}

.project-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.project-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 32px 20px 24px;
}

.project-card-eyebrow {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  font-weight: 600;
  color: var(--brand-secondary);
}

.project-card h4 {
  margin: 0;
  font: 700 1.15rem/1.35 'Inter', system-ui;
  color: var(--neutral-900);
}

.project-card-tagline {
  margin: 0;
  color: var(--neutral-700);
  font-size: 1rem;
}

.project-card-users {
  margin: 0;
  font-size: 0.9rem;
  color: var(--neutral-700);
}

.project-card-status {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--neutral-300);
  background: var(--neutral-100);
  color: var(--neutral-900);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.project-card:hover,
.project-card:focus {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-primary);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: start;
}

.about-stats {
  display: grid;
  gap: 18px;
}

.about-stats article {
  background: var(--neutral-0);
  border-radius: var(--border-radius-md);
  padding: 24px;
  border: 1px solid var(--neutral-300);
  box-shadow: var(--shadow-sm);
}

.contact-form {
  display: grid;
  gap: 14px;
  max-width: 520px;
}

.contact-form label {
  font-weight: 600;
  color: var(--neutral-900);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--neutral-300);
  background: var(--neutral-0);
  font: inherit;
  transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.12);
}

.contact-form .btn {
  justify-self: start;
}

.contact-form.is-submitting .btn {
  pointer-events: none;
  opacity: 0.7;
}

.form-status {
  margin: 8px 0 0;
  color: var(--neutral-900);
}

.site-footer {
  padding: 32px min(5vw, 40px) 48px;
  border-top: 1px solid var(--neutral-300);
  color: var(--neutral-700);
  background: var(--neutral-100);
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.footer-contact {
  text-decoration: none;
  font-weight: 600;
}

.footer-logo {
  max-height: 60px; /* Adjust size as needed for "significant" */
  width: auto;
  margin-left: auto; /* Pushes the logo to the right */
}

.project-article {
  display: grid;
  gap: clamp(32px, 4vw, 48px);
}

.project-hero {
  background: linear-gradient(140deg, var(--neutral-0), var(--neutral-100));
  color: inherit;
  padding: clamp(40px, 6vw, 72px);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--neutral-300);
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
}

.project-hero h1 {
  color: var(--neutral-900);
  margin: 0 0 12px;
}

.project-tagline {
  color: var(--neutral-700);
  font-size: 1.1rem;
  margin: 0 0 20px;
  max-width: 640px;
}

.project-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 18px;
  margin: 28px 0 0;
}

.project-meta-grid dt {
  margin: 0 0 4px;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--neutral-700);
  font-weight: 600;
}

.project-meta-grid dd {
  margin: 0;
  font-weight: 600;
  color: var(--neutral-900);
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.project-gallery figure {
  margin: 0;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  border: 1px solid var(--neutral-300);
  box-shadow: var(--shadow-md);
}

.project-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-body {
  display: grid;
  gap: clamp(28px, 4vw, 40px);
}

.project-section {
  background: var(--neutral-0);
  border: 1px solid var(--neutral-300);
  border-radius: var(--border-radius-lg);
  padding: clamp(32px, 5vw, 48px);
  box-shadow: var(--shadow-md);
}

.project-section > h2 {
  margin: 0 0 24px;
  color: var(--neutral-900);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--neutral-300);
}

.project-section-grid {
  display: grid;
  gap: 20px;
}

.project-section-block h3 {
  margin: 0 0 10px;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-secondary);
  font-weight: 700;
}

.project-section-block p {
  margin: 0 0 12px;
  color: var(--neutral-700);
}

.project-section-block ul {
  margin: 0;
  padding-left: 20px;
  color: var(--neutral-700);
}

.project-section-block ul li {
  margin-bottom: 6px;
}

.project-section .btn {
  margin-top: 4px;
}

.show-more {
  margin-top: 24px;
  width: 100%;
}

@media (max-width: 680px) {
  body {
    font-size: 0.9rem;
  }
  
  h1 {
    font-size: clamp(28px, 7vw, 42px);
  }

  h2 {
    font-size: clamp(22px, 6vw, 32px);
  }

  h3 {
    font-size: 1.1rem;
  }

  .site-header {
    flex-wrap: nowrap;
    padding: 12px 16px;
    gap: 16px;
    justify-content: space-evenly;
  }

  .header-nav {
    justify-content: center;
    flex-shrink: 1;
  }

  .site-header .header-nav a {
    margin: 0 4px;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .logo img {
    max-height: 40px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-visual {
    order: -1;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .project-hero {
    padding: clamp(24px, 5vw, 40px);
  }

  .project-meta-grid {
    grid-template-columns: 1fr;
  }

  .project-section {
    padding: 24px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 24px;
  }

  .footer-logo {
    margin-left: 0;
  }

  .grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 0;
    overflow-x: hidden;
  }

  .has-arrows .grid {
    flex-direction: row;
    padding-bottom: 20px;
  }

  .has-arrows .nav-arrow {
    top: 50%;
    transform: translateY(-50%);
  }

  .has-arrows .left-arrow {
    left: 5px;
  }

  .has-arrows .right-arrow {
    right: 5px;
  }
}

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

#loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px; /* Adjust as needed */
}

#loading-spinner .spinner {
  border: 4px solid rgba(0, 0, 0, .1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: var(--brand-primary); /* Using brand primary color */
  animation: spin 1s ease infinite;
}

.hidden {
  display: none !important;
}

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

/* Particles Background */
#particles-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  #particles-canvas {
    display: none;
  }
}
