/* =========================================================
   TrailBridge Consulting Services — Stylesheet
   ========================================================= */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

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

:root {
  --primary-color: #0070f3;
  --secondary-color: #00a4ff;
  --bg-color: #ffffff;
  --text-color: #1a1a1a;
  --text-muted: #4b5563;
  --card-bg: #f7f9fc;
  --card-border: #e5e9f0;
  --nav-border: #eef1f6;
  --footer-bg: #0b1220;
  --footer-text: #cbd5e1;

  --font-display: "Sora", -apple-system, sans-serif;
  --font-body: "Inter", -apple-system, sans-serif;
}

body.dark-mode {
  --bg-color: #0b1220;
  --text-color: #f1f5f9;
  --text-muted: #94a3b8;
  --card-bg: #131b2c;
  --card-border: #223049;
  --nav-border: #1c2740;
  --footer-bg: #060a12;
  --footer-text: #94a3b8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-color);
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
  line-height: 1.6;
}

a {
  color: var(--primary-color);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.text-center {
  text-align: center;
}

/* ---------- Navbar ---------- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--nav-border);
  position: sticky;
  top: 0;
  background-color: var(--bg-color);
  z-index: 100;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand-icon {
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.2px;
  color: var(--text-color);
}

.brand-tagline {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.62rem;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--primary-color);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-links a:hover {
  color: var(--primary-color);
}

.nav-links a.active {
  color: var(--primary-color);
}

.nav-links a.active::after {
  transform: scaleX(1);
}

#themeToggle {
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  border-radius: 8px;
  font-size: 1.1rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  line-height: 1;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background-color: #050d1c;
  color: #ffffff;
  padding: 6rem 1.5rem;
  text-align: center;
}

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

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}

.hero-icon {
  margin-bottom: 1.25rem;
  animation: heroBump 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  font-weight: 800;
  margin: 0 0 1.25rem;
  letter-spacing: -0.5px;
}

.hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(22px);
  animation: heroWordReveal 0.65s ease forwards;
  animation-delay: calc(0.55s + var(--i) * 0.16s);
}

.hero-word:not(:last-child)::after {
  content: " ";
}

.hero-subtext {
  font-family: var(--font-body);
  font-size: 1.15rem;
  opacity: 0;
  transform: translateY(16px);
  animation: heroWordReveal 0.7s ease forwards;
  animation-delay: 1.25s;
}

@keyframes heroBump {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(-10deg);
  }
  55% {
    opacity: 1;
    transform: scale(1.3) rotate(5deg);
  }
  75% {
    transform: scale(0.92) rotate(-2deg);
  }
  90% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes heroWordReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-icon,
  .hero-word,
  .hero-subtext {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.hero-scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0;
  animation: heroWordReveal 0.7s ease forwards;
  animation-delay: 1.9s;
}

.hero-scroll-cue svg {
  animation: scrollBounce 1.8s ease-in-out infinite;
}

.hero-scroll-cue:hover {
  color: #ffffff;
}

@keyframes scrollBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

.hero-divider {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: 60px;
  z-index: 1;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .hero-scroll-cue,
  .hero-scroll-cue svg {
    animation: none;
    opacity: 1;
  }
}

/* ---------- Sections / Headings ---------- */
h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

h3 {
  font-family: var(--font-display);
}

#about p {
  color: var(--text-muted);
  max-width: 760px;
  font-size: 1.05rem;
}

/* ---------- Services Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.75rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.card h3 {
  color: var(--primary-color);
  margin-top: 0;
  font-size: 1.15rem;
}

.card p {
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ---------- Contact ---------- */
.contact-subtext {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: var(--text-muted);
}

.email-box {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 1.25rem 2.5rem;
  border-radius: 10px;
  font-size: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.email-icon {
  font-size: 1.5rem;
}

.contact-email {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s ease;
}

.contact-email:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* ---------- Footer ---------- */
footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
}

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

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

.grid .reveal:nth-child(2) {
  transition-delay: 0.1s;
}

.grid .reveal:nth-child(3) {
  transition-delay: 0.2s;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s;
  z-index: 90;
}

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

.back-to-top:hover {
  background-color: var(--primary-color);
  color: #ffffff;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .navbar {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .hero {
    padding: 4rem 1.25rem;
  }

  .email-box {
    padding: 1rem 1.5rem;
    font-size: 1.05rem;
  }
}
