/* ================================================================
   styles.css — CipherShield Landing Page
   Order: reset/base → tokens → nav → hero → sections →
          components → animations → responsive
================================================================ */

/* ----------------------------------------------------------------
   1. CSS CUSTOM PROPERTIES (Design Tokens)
---------------------------------------------------------------- */
:root {
  --color-bg:         #0a0e17;
  --color-surface:    #111827;
  --color-border:     #1e293b;
  --color-accent:     #00aaff;
  --color-cta:        #00ff88;
  --color-text:       #ffffff;
  --color-text-muted: #c8d0e0;
  --color-text-dark:  #0a0e17;

  --font-main: 'Space Grotesk', system-ui, sans-serif;

  --nav-height: 72px;
  --container-max: 1160px;
  --radius-card: 12px;

  --transition-base: 0.25s ease;
  --transition-long: 0.6s ease;
}

/* ----------------------------------------------------------------
   2. RESET & BASE
---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
}

/* Visually hidden (accessible) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip navigation link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-cta);
  color: var(--color-text-dark);
  padding: 0.5rem 1rem;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* Focus-visible ring for keyboard users */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Layout container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ----------------------------------------------------------------
   3. BUTTONS
---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform var(--transition-base), box-shadow var(--transition-base), opacity var(--transition-base);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

/* Green CTA button */
.btn-cta {
  background-color: var(--color-cta);
  color: var(--color-text-dark);
}

.btn-cta:hover {
  box-shadow: 0 0 18px rgba(0, 255, 136, 0.45);
}

/* Ghost / outline button */
.btn-ghost {
  background-color: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}

.btn-ghost:hover {
  background-color: rgba(0, 170, 255, 0.08);
  box-shadow: 0 0 14px rgba(0, 170, 255, 0.3);
}

/* ----------------------------------------------------------------
   4. NAVIGATION
---------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  transition: background var(--transition-base), backdrop-filter var(--transition-base), box-shadow var(--transition-base);
}

.site-header.scrolled {
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--color-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: var(--nav-height);
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-accent);
  flex-shrink: 0;
}

.logo-icon {
  font-size: 1.4rem;
}

.logo-text {
  color: var(--color-accent);
}

/* Desktop nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-inline-start: auto;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition-base);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform var(--transition-base);
  border-radius: 2px;
}

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

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

/* Desktop CTA in nav */
.nav-cta {
  flex-shrink: 0;
  padding: 0.55rem 1.25rem;
  font-size: 0.9rem;
}

/* Hamburger button */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: 6px;
  transition: background var(--transition-base);
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.07);
}

.hamburger-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

/* Hamburger → X when open */
.hamburger[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu */
.mobile-menu {
  background: rgba(10, 14, 23, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--color-border);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}

.mobile-menu.open {
  max-height: 400px;
}

.mobile-menu ul {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1rem 1.5rem 1.5rem;
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  transition: color var(--transition-base);
}

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

.mobile-cta {
  margin-top: 1.25rem;
  width: 100%;
}

/* ----------------------------------------------------------------
   5. HERO
---------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  text-align: center;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
  padding: calc(var(--nav-height) + 2rem) 1.5rem 4rem;
}

.hero-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-cta);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: var(--color-text);
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--color-text-muted);
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: 2.5rem;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Scroll-down chevron */
.scroll-chevron {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  color: var(--color-text-muted);
  animation: bounce 2s ease-in-out infinite;
  transition: color var(--transition-base);
}

.scroll-chevron:hover {
  color: var(--color-accent);
}

/* ----------------------------------------------------------------
   6. SECTIONS (shared)
---------------------------------------------------------------- */
.section {
  padding-block: 6rem;
}

/* Prevent fixed nav from obscuring jump targets */
[id] {
  scroll-margin-top: var(--nav-height);
}

.section-alt {
  background-color: var(--color-surface);
}

.section-heading {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 3.5rem;
  position: relative;
}

/* Accent underline on section headings */
.section-heading::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
  margin: 0.75rem auto 0;
}

/* ----------------------------------------------------------------
   7. SERVICES CARDS
---------------------------------------------------------------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 2rem;
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--color-accent);
  box-shadow: 0 0 20px rgba(0, 170, 255, 0.15);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.card-body {
  font-size: 0.93rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ----------------------------------------------------------------
   8. WHY CIPHERSHIELD — STATS
---------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
}

.stat-col {
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.stat-col:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 20px rgba(0, 170, 255, 0.1);
}

.stat-number {
  display: block;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* For the text-based stat (< 15 min) */
.stat-text {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.stat-label {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.stat-sub {
  display: block;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ----------------------------------------------------------------
   9. HOW IT WORKS — STEPS
---------------------------------------------------------------- */
.steps-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.step {
  flex: 1;
  text-align: center;
  padding: 2rem 1.5rem;
}

/* Dashed connector line between steps */
.step-connector {
  flex: 0 0 60px;
  height: 2px;
  margin-top: 3.25rem; /* aligns with centre of step number circle */
  border-top: 2px dashed var(--color-border);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.step-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

.step-body {
  font-size: 0.93rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 280px;
  margin-inline: auto;
}

/* ----------------------------------------------------------------
   10. TESTIMONIALS
---------------------------------------------------------------- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.testimonial-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.testimonial-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 20px rgba(0, 170, 255, 0.1);
  transform: translateY(-4px);
}

.testimonial-quote {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.75;
  font-style: normal; /* blockquote default italic override */
}

.testimonial-author {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.author-rule {
  width: 40px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
}

.testimonial-author cite {
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.testimonial-author strong {
  font-size: 0.95rem;
  color: var(--color-text);
}

.author-role {
  font-size: 0.83rem;
  color: var(--color-text-muted);
}

/* ----------------------------------------------------------------
   11. CONTACT / CTA BANNER
---------------------------------------------------------------- */
.contact-section {
  background: linear-gradient(135deg, #050d1a 0%, #0d1f3c 50%, #050d1a 100%);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.contact-inner {
  text-align: center;
  max-width: 680px;
}

.contact-sub {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
}

.contact-form-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.contact-form {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  max-width: 520px;
  flex-wrap: wrap;
  justify-content: center;
}

.contact-input {
  flex: 1;
  min-width: 220px;
  padding: 0.75rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.contact-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.contact-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.15);
}

.contact-input.input-error {
  border-color: #ff4d6a;
  box-shadow: 0 0 0 3px rgba(255, 77, 106, 0.15);
}

.contact-submit {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
}

.contact-success {
  font-size: 1rem;
  color: var(--color-cta);
  font-weight: 500;
  padding: 1rem;
}

.field-error {
  font-size: 0.88rem;
  color: #ff4d6a;
  width: 100%;
  text-align: left;
  padding-left: 0.25rem;
}

/* ----------------------------------------------------------------
   12. FOOTER
---------------------------------------------------------------- */
.site-footer {
  background: #070b12;
  border-top: 1px solid var(--color-border);
  padding-block: 2.5rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-logo {
  font-size: 1rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  transition: color var(--transition-base);
}

.footer-link:hover {
  color: var(--color-text);
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: 1rem;
  transition: border-color var(--transition-base), background var(--transition-base), transform var(--transition-base);
}

.social-link:hover {
  border-color: var(--color-accent);
  background: rgba(0, 170, 255, 0.08);
  transform: translateY(-2px);
}

.footer-row-copy {
  justify-content: center;
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* ----------------------------------------------------------------
   13. ANIMATIONS & KEYFRAMES
---------------------------------------------------------------- */

/* Scroll-triggered fade-up */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-long), transform var(--transition-long);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: none;
}

/* CTA pulse glow */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 136, 0);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(0, 255, 136, 0.22), 0 0 28px rgba(0, 255, 136, 0.18);
  }
}

.btn-pulse {
  animation: pulse-glow 2.8s ease-in-out infinite;
}

.btn-pulse:hover {
  animation-play-state: paused;
}

/* Scroll chevron bounce */
@keyframes bounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(8px);
  }
}

/* ----------------------------------------------------------------
   14. RESPONSIVE — TABLET (< 1024px)
---------------------------------------------------------------- */
@media (max-width: 1024px) {
  .steps-row {
    flex-direction: column;
    align-items: center;
  }

  .step-connector {
    flex: 0 0 auto;
    width: 2px;
    height: 40px;
    margin-top: 0;
    border-top: none;
    border-left: 2px dashed var(--color-border);
  }

  .step {
    width: 100%;
    max-width: 480px;
  }
}

/* ----------------------------------------------------------------
   15. RESPONSIVE — MOBILE (< 768px)
---------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Nav */
  .nav-links,
  .nav-cta {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-menu {
    display: block;
  }

  /* Hero CTAs */
  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
    max-width: 300px;
    margin-inline: auto;
  }

  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
  }

  /* Sections */
  .section {
    padding-block: 4rem;
  }

  /* Footer */
  .footer-row-main {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }

  .footer-links {
    gap: 1rem;
  }

  /* Contact form */
  .contact-form {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-input {
    min-width: 0;
    width: 100%;
  }

  .contact-submit {
    width: 100%;
  }
}

/* ----------------------------------------------------------------
   16. RESPONSIVE — SMALL MOBILE (< 480px)
---------------------------------------------------------------- */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

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

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

/* ----------------------------------------------------------------
   17. REDUCED MOTION — respect user preference (WCAG 2.1 AA)
---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn-pulse {
    animation: none;
  }

  .scroll-chevron {
    animation: none;
  }

  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
