/* =========================================================
   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: "Plus Jakarta Sans", -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;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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: 2rem 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;
}

.brand-icon-wrap {
  width: 76px;
  height: 83px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.brand-icon-scale {
  position: relative;
  width: 180px;
  height: 196px;
  transform: scale(0.42);
  transform-origin: top left;
}

.hero-icon-wrap {
  position: relative;
  width: 130px;
  height: 140px;
  margin: 0 auto 1.25rem;
}

.hero-icon-scale {
  position: relative;
  width: 180px;
  height: 196px;
  transform: scale(0.72);
  transform-origin: top left;
}

.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.55rem;
  letter-spacing: 0.2px;
  color: var(--text-color);
}

.brand-tagline {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 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;
}

/* Logo Sequential Animation Rules */
.anim-cloud {
  opacity: 0;
  transform-box: view-box;
  transform-origin: 150px 160px;
  animation:
    cloudDrop 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards,
    cloudPush 0.55s ease-out 1.05s;
}

/* Cloud gives a small squash as it pushes TBCS out */
@keyframes cloudPush {
  0% {
    transform: scale(1, 1);
  }
  35% {
    transform: scale(1.06, 0.92);
  }
  70% {
    transform: scale(0.98, 1.03);
  }
  100% {
    transform: scale(1, 1);
  }
}

.anim-cloud-text {
  opacity: 0;
  transform-box: view-box;
  transform-origin: 150px 185px;
  animation: tbcsEmerge 1s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
  animation-delay: 1.05s;
}

.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(2s + 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: 2.55s;
}

@keyframes cloudDrop {
  0% {
    opacity: 0;
    transform: translateY(-80px);
  }
  70% {
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* TBCS is painted behind the cloud, starts tucked up inside it,
   then pushes downward and scales up as it emerges. */
@keyframes tbcsEmerge {
  0% {
    opacity: 0;
    transform: translateY(-88px) scale(0.45);
  }
  30% {
    opacity: 1;
  }
  70% {
    transform: translateY(6px) scale(1.06);
  }
  85% {
    transform: translateY(-2px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .anim-cloud,
  .anim-cloud-text,
  .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: 2.95s;
}

.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;
}

/* ---------- Page banner (Services / Contact) ---------- */
.page-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #071226 0%, #0b2547 55%, #12406f 100%);
  color: #ffffff;
  padding: 3.5rem 1.5rem;
  text-align: center;
}

.page-banner h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  font-weight: 800;
  margin: 0 0 0.6rem;
}

.page-banner p {
  font-family: var(--font-body);
  font-size: 1.05rem;
  opacity: 0.9;
  max-width: 620px;
  margin: 0 auto;
}

@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);
}

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

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

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

@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.card {
  position: relative;
  overflow: hidden;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 10px 24px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  opacity: 0;
  transform: scaleX(0.85);
  transform-origin: left;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.06),
    0 24px 40px rgba(0, 112, 243, 0.16);
}

.card:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

.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;
}

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

.value-prop h3 {
  color: var(--primary-color);
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}

.value-prop p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.98rem;
}

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: #ffffff;
  text-align: center;
  padding: 3.5rem 1.5rem;
}

.cta-banner h2 {
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.cta-banner p {
  font-size: 1.05rem;
  opacity: 0.95;
  max-width: 560px;
  margin: 0 auto 1.75rem;
}

.btn-white {
  display: inline-block;
  background-color: #ffffff;
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  padding: 0.85rem 2rem;
  border-radius: 8px;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ---------- Process steps ---------- */
.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
  counter-reset: step;
}

@media (max-width: 820px) {
  .process-steps {
    grid-template-columns: 1fr;
  }
}

.process-step {
  position: relative;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2.25rem 1.5rem 1.75rem;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 10px 24px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.process-step:hover {
  transform: translateY(-6px);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.06),
    0 20px 36px rgba(0, 112, 243, 0.14);
}

.process-step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: -20px;
  left: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-color);
  border: 1px solid var(--card-border);
  color: var(--primary-color);
  font-family: var(--font-display);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.process-step:not(:first-child)::after {
  content: "";
  position: absolute;
  top: 0;
  left: -1.5rem;
  width: 1.5rem;
  height: 2px;
  background-color: var(--card-border);
}

@media (max-width: 820px) {
  .process-step:not(:first-child)::after {
    display: none;
  }
}

.process-step h3 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}

.process-step p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.95rem;
}

/* ---------- Contact form ---------- */
.contact-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 420px;
  margin: 2.5rem auto;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.contact-divider::before,
.contact-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--card-border);
}

.contact-form {
  max-width: 480px;
  margin: 0 auto;
  text-align: left;
}

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

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

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  color: var(--text-color);
  font-family: var(--font-body);
  font-size: 0.98rem;
}

.form-field textarea {
  min-height: 140px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-field input.invalid {
  border-color: #e24b4a;
}

.field-error {
  display: block;
  min-height: 1.1rem;
  margin-top: 0.35rem;
  color: #e24b4a;
  font-size: 0.85rem;
}

.btn-primary {
  display: inline-block;
  background-color: var(--primary-color);
  color: #ffffff;
  font-weight: 600;
  border: none;
  text-decoration: none;
  padding: 0.85rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 112, 243, 0.25);
}

.form-status {
  margin-top: 1rem;
  font-size: 0.95rem;
  min-height: 1.2rem;
}

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

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  list-style: none;
  padding: 0;
}

.footer-links a {
  color: var(--footer-text);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: #ffffff;
}

/* ---------- 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;
  }
}
