/* =========================================================
   NexusForge — Modern Corporate Single-Page Stylesheet
   Clean, modular, WordPress-ready
   ========================================================= */

/* -------------------- CSS Custom Properties -------------------- */
:root {
  /* Colors */
  --color-primary: #0F172A;       /* Deep Navy / Slate */
  --color-primary-light: #1E293B;
  --color-accent: #3B82F6;        /* Electric Blue */
  --color-accent-hover: #2563EB;
  --color-accent-soft: rgba(59, 130, 246, 0.12);
  --color-success: #10B981;
  --color-text: #0F172A;
  --color-text-muted: #64748B;
  --color-text-light: #94A3B8;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F8FAFC;
  --color-bg-dark: #0F172A;
  --color-border: #E2E8F0;
  --color-border-light: #F1F5F9;

  /* Typography */
  --font-heading: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Spacing & Layout */
  --container-max: 1140px;
  --section-padding: 6rem 0;
  --header-height: 72px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -------------------- Reset & Base -------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

ul, ol {
  list-style: none;
}

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

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

.section {
  padding: var(--section-padding);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3.5rem;
}

.section-desc {
  color: var(--color-text-muted);
  margin-top: 0.75rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-primary);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* -------------------- Buttons -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  background: var(--color-bg-alt);
}

.btn-sm {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

/* -------------------- Header -------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: all var(--transition);
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary);
  flex-shrink: 0;
}

.logo-text {
  letter-spacing: -0.02em;
}

.main-nav {
  display: none;
}

@media (min-width: 900px) {
  .main-nav {
    display: block;
  }
}

.nav-list {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 0.875rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: 6px;
  transition: all var(--transition);
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-actions .btn {
  display: none;
}

@media (min-width: 900px) {
  .header-actions .btn {
    display: inline-flex;
  }
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
}

@media (min-width: 900px) {
  .hamburger {
    display: none;
  }
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  padding: 2rem 1.5rem;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  overflow-y: auto;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 2rem;
}

.mobile-nav-link {
  display: block;
  padding: 0.875rem 1rem;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-primary);
  border-radius: var(--radius-sm);
}

.mobile-nav-link:hover {
  background: var(--color-bg-alt);
}

/* -------------------- Hero -------------------- */
.hero {
  padding: calc(var(--header-height) + 4rem) 0 5rem;
  background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
  }
}

.hero-content .eyebrow {
  margin-bottom: 1rem;
}

.hero-content h1 {
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 520px;
  margin-bottom: 2rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-card {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.hero-card-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 50% 40%, rgba(59, 130, 246, 0.25), transparent 60%);
  pointer-events: none;
}

.hero-svg {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* -------------------- Logo Ticker -------------------- */
.logo-ticker {
  padding: 2.5rem 0;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
  overflow: hidden;
}

.ticker-label {
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

.ticker-track-wrapper {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}

.ticker-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: ticker 30s linear infinite;
}

.ticker-item {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.ticker-item:hover {
  opacity: 1;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* -------------------- About + Metrics -------------------- */
.about {
  background: var(--color-bg);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
  }
}

.about-content h2 {
  margin-bottom: 1.25rem;
}

.about-content p {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.values-list {
  margin-top: 1.5rem;
}

.values-list li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--color-text-muted);
}

.values-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.9rem;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
}

.values-list strong {
  color: var(--color-primary);
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.metric-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
  transition: all var(--transition);
}

.metric-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.metric-number {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.03em;
}

.metric-suffix {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
}

.metric-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 0.35rem;
}

/* -------------------- Services -------------------- */
.services {
  background: var(--color-bg-alt);
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 700px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.service-card {
  background: white;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  transition: all var(--transition);
}

.service-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.service-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border-radius: 12px;
  margin-bottom: 1.25rem;
}

.service-card h3 {
  margin-bottom: 0.75rem;
}

.service-card p {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

.service-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-accent);
}

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

/* -------------------- Portfolio -------------------- */
.portfolio {
  background: var(--color-bg);
}

.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

@media (min-width: 600px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.portfolio-card {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.portfolio-card.hidden {
  display: none;
}

.portfolio-thumb {
  position: relative;
  display: block;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--color-bg-alt);
}

.portfolio-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.portfolio-overlay span {
  color: white;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.625rem 1.25rem;
  border: 1.5px solid white;
  border-radius: 999px;
}

.portfolio-thumb:hover img {
  transform: scale(1.05);
}

.portfolio-thumb:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-info {
  padding: 1rem 0.25rem 0;
}

.portfolio-info h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.25rem;
}

.portfolio-cat {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
}

.lightbox-content {
  position: relative;
  max-width: 900px;
  width: 90%;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox.open .lightbox-content {
  transform: scale(1);
}

.lightbox-content img {
  width: 100%;
  max-height: 60vh;
  object-fit: cover;
}

.lightbox-meta {
  padding: 1.25rem 1.5rem;
}

.lightbox-meta h3 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.lightbox-meta span {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 40px;
  height: 40px;
  background: rgba(15, 23, 42, 0.7);
  color: white;
  font-size: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background var(--transition);
}

.lightbox-close:hover {
  background: var(--color-primary);
}

/* -------------------- Testimonials -------------------- */
.testimonials {
  background: var(--color-bg-alt);
}

.testimonial-slider {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  overflow: hidden;
}

.testimonial-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-slide {
  min-width: 100%;
  padding: 0 0.5rem;
}

.testimonial-card {
  background: white;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
}

.stars {
  color: #FBBF24;
  font-size: 1.125rem;
  letter-spacing: 2px;
  margin-bottom: 1.25rem;
}

.testimonial-card blockquote p {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 1.75rem;
}

.testimonial-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
}

.author-avatar {
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  color: white;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.testimonial-author cite {
  font-style: normal;
  font-weight: 600;
  display: block;
}

.testimonial-author span {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.slider-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-primary);
  transition: all var(--transition);
}

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

.slider-dots {
  display: flex;
  gap: 0.5rem;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  transition: all var(--transition);
}

.slider-dot.active {
  background: var(--color-accent);
  transform: scale(1.25);
}

/* -------------------- Contact -------------------- */
.contact {
  background: var(--color-bg);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
}

@media (min-width: 800px) {
  .contact-grid {
    grid-template-columns: 1fr 1.1fr;
    gap: 5rem;
  }
}

.contact-info h2 {
  margin-bottom: 1rem;
}

.contact-info > p {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.contact-details li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contact-details strong {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-light);
}

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

.social-links {
  display: flex;
  gap: 0.75rem;
}

.social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-text-muted);
  transition: all var(--transition);
}

.social-link:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

/* Form */
.contact-form-wrapper {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--color-primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.form-group input.error,
.form-group textarea.error {
  border-color: #EF4444;
}

.error-msg {
  display: block;
  font-size: 0.8125rem;
  color: #EF4444;
  margin-top: 0.35rem;
  min-height: 1.2em;
}

.form-success {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-align: center;
}

/* -------------------- Footer -------------------- */
.site-footer {
  background: var(--color-bg-dark);
  color: #CBD5E1;
  padding: 4.5rem 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
    gap: 2rem;
  }
}

.footer-brand .logo {
  color: white;
  margin-bottom: 1rem;
}

.footer-brand p {
  font-size: 0.9375rem;
  line-height: 1.6;
  max-width: 280px;
}

.footer-col h4 {
  color: white;
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer-col a {
  font-size: 0.9rem;
  color: #94A3B8;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: white;
}

.footer-newsletter p {
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
}

.newsletter-form input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  color: white;
}

.newsletter-form input::placeholder {
  color: #64748B;
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem 0;
  font-size: 0.875rem;
  color: #64748B;
}

@media (min-width: 600px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-legal {
  display: flex;
  gap: 1.5rem;
}

.footer-legal a:hover {
  color: white;
}

/* -------------------- Back to Top -------------------- */
.back-to-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 46px;
  height: 46px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--transition);
  z-index: 900;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-accent);
  transform: translateY(-2px);
}

/* -------------------- Scroll Reveal -------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Stagger children slightly */
.services-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.services-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.portfolio-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.portfolio-grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.portfolio-grid .reveal:nth-child(4) { transition-delay: 0.24s; }
.portfolio-grid .reveal:nth-child(5) { transition-delay: 0.32s; }
.portfolio-grid .reveal:nth-child(6) { transition-delay: 0.4s; }

/* -------------------- Responsive Tweaks -------------------- */
@media (max-width: 599px) {
  :root {
    --section-padding: 4rem 0;
  }

  .hero {
    padding-top: calc(var(--header-height) + 2.5rem);
  }

  .contact-form-wrapper {
    padding: 1.75rem 1.25rem;
  }

  .newsletter-form {
    flex-direction: column;
  }
}
