/* Rails Tech Ltd — Core brand overrides */

:root {
  --navy: #0f172a;
  --techblue: #2563eb;
  --silver: #c0c7d1;
  --white: #ffffff;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
}

::selection {
  background-color: var(--techblue);
  color: var(--white);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--navy);
}

::-webkit-scrollbar-thumb {
  background: var(--silver);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--techblue);
}

/* Anchor offset for sticky nav */
section[id] {
  scroll-margin-top: 5.5rem;
}

/* Brand animations */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes hero-glow {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.6;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.6;
  }
}

.animate-fade-up {
  animation: fade-up 0.8s ease-out forwards;
}

.animate-fade-in {
  animation: fade-in 0.6s ease-out forwards;
}

.animate-hero-glow {
  animation: hero-glow 6s ease-in-out infinite;
}

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

.animation-delay-100 {
  animation-delay: 0.1s;
}

.animation-delay-200 {
  animation-delay: 0.2s;
}

.animation-delay-300 {
  animation-delay: 0.3s;
}

.animation-delay-400 {
  animation-delay: 0.4s;
}

/* Focus states */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--techblue);
  outline-offset: 2px;
}

/* Form validation */
.form-field.is-invalid input,
.form-field.is-invalid textarea {
  border-color: #ef4444;
}

.form-field.is-invalid .field-error {
  display: block;
}

.field-error {
  display: none;
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.375rem;
}

.form-field.is-valid input,
.form-field.is-valid textarea {
  border-color: #22c55e;
}

/* Card hover lift */
.card-hover {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(37, 99, 235, 0.15);
  border-color: var(--techblue);
}

/* Mobile nav transition */
#mobile-menu {
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

#mobile-menu.is-open {
  max-height: 20rem;
  opacity: 1;
}

#mobile-menu.is-closed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

/* Hero grid accent */
.hero-grid {
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .animate-fade-up,
  .animate-fade-in,
  .animate-hero-glow,
  .animate-pulse-ring {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .card-hover:hover {
    transform: none;
  }
}
