/* ============================================
   TNSafety - Custom Styles
   Built on Bootstrap 5.3
   Palette: deep navy, gold accent, off-white
   ============================================ */

:root {
  --tn-navy: #0d1b2a;
  --tn-navy-2: #1b2a3e;
  --tn-gold: #d4a92c;
  --tn-gold-bright: #f5c542;
  --tn-cream: #f5f1e8;
  --tn-gray: #6c7a89;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #1a1a1a;
  background: #fff;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---------- NAVBAR ---------- */
.navbar-tn {
  background: var(--tn-navy);
  padding: 0.6rem 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.navbar-tn .navbar-brand {
  color: var(--tn-cream);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0;
  line-height: 1;
}
.navbar-tn .navbar-brand .brand-logo {
  height: 44px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}
.navbar-tn .navbar-brand .brand-text { display: inline-block; }
.navbar-tn .navbar-brand .brand-accent { color: var(--tn-gold); }
@media (max-width: 360px) {
  .navbar-tn .navbar-brand .brand-text { display: none; } /* logo alone on the smallest phones */
  .navbar-tn .navbar-brand .brand-logo { height: 40px; }
}
.navbar-tn .nav-link {
  color: rgba(255,255,255,0.85) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  transition: color 0.2s;
}
.navbar-tn .nav-link:hover,
.navbar-tn .nav-link.active {
  color: var(--tn-gold) !important;
}
.navbar-tn .navbar-toggler {
  border-color: rgba(255,255,255,0.3);
}
.navbar-tn .navbar-toggler-icon {
  filter: invert(1);
}
.navbar-cta {
  background: var(--tn-gold);
  color: var(--tn-navy) !important;
  font-weight: 700;
  border-radius: 4px;
  padding: 0.45rem 1.1rem !important;
  margin-left: 0.5rem;
  transition: background 0.2s;
}
.navbar-cta:hover {
  background: var(--tn-gold-bright);
  color: var(--tn-navy) !important;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  /* Navy gradient (top-left heavier) over American flag photo —
     keeps text legible while letting the flag's reds/whites read through. */
  background:
    linear-gradient(135deg, rgba(13,27,42,0.78) 0%, rgba(13,27,42,0.55) 55%, rgba(27,42,62,0.78) 100%),
    url('../images/hero-flag.jpg') center/cover no-repeat;
  background-attachment: scroll; /* fixed parallax breaks on iOS — keep scroll */
  color: #fff;
  text-align: center;
  padding: 6rem 1rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  text-shadow: 0 2px 14px rgba(0,0,0,0.55), 0 1px 2px rgba(0,0,0,0.4);
}
.hero h1 .accent { color: var(--tn-gold); }
.hero .lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  max-width: 720px;
  margin: 1.25rem auto 2rem;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 1px 6px rgba(0,0,0,0.45);
}
.hero-page {
  min-height: 40vh;
  padding: 4rem 1rem;
}

/* ---------- BUTTONS ---------- */
.btn-gold {
  background: var(--tn-gold);
  color: var(--tn-navy);
  font-weight: 700;
  border: none;
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  transition: all 0.2s;
}
.btn-gold:hover {
  background: var(--tn-gold-bright);
  color: var(--tn-navy);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(212, 169, 44, 0.3);
}
.btn-outline-light-tn {
  border: 2px solid #fff;
  color: #fff;
  font-weight: 600;
  padding: 0.7rem 1.5rem;
  border-radius: 4px;
  background: transparent;
  transition: all 0.2s;
}
.btn-outline-light-tn:hover {
  background: #fff;
  color: var(--tn-navy);
}

/* ---------- SECTIONS ---------- */
.section {
  padding: 5rem 0;
}
.section-dark {
  background: var(--tn-navy);
  color: #fff;
}
.section-cream {
  background: var(--tn-cream);
}
.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 0.75rem;
}
.section-subtitle {
  color: var(--tn-gray);
  font-size: 1.1rem;
  margin-bottom: 3rem;
}
.section-dark .section-subtitle { color: rgba(255,255,255,0.75); }

.divider-gold {
  width: 60px;
  height: 4px;
  background: var(--tn-gold);
  border: 0;
  margin: 0 auto 1.5rem;
  opacity: 1;
}

/* ---------- VALUE PROP CARDS ---------- */
.value-card {
  background: #fff;
  border-radius: 8px;
  padding: 2rem 1.5rem;
  height: 100%;
  text-align: center;
  border-top: 4px solid var(--tn-gold);
  box-shadow: 0 4px 18px rgba(0,0,0,0.06);
  transition: transform 0.25s, box-shadow 0.25s;
}
.value-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}
.value-card .icon {
  font-size: 2.5rem;
  color: var(--tn-gold);
  margin-bottom: 1rem;
}
.value-card h4 {
  color: var(--tn-navy);
  font-size: 1.2rem;
}

/* ---------- SERVICE CARDS ---------- */
.service-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s, box-shadow 0.25s;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.14);
}
.service-card .service-img {
  height: 220px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.service-card .service-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(13,27,42,0.4));
}
.service-card .service-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.service-card h4 {
  color: var(--tn-navy);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}
.service-card .service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--tn-gold);
  color: var(--tn-navy);
  border-radius: 50%;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

/* ---------- TEAM / PROFILE CARDS ---------- */
.profile-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  margin-bottom: 2rem;
  transition: transform 0.3s, box-shadow 0.3s;
}
.profile-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.16);
}
.profile-card .profile-portrait {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.profile-card .profile-body {
  padding: 1.5rem;
}
.profile-card .profile-body h4 {
  color: var(--tn-navy);
  margin-bottom: 0.2rem;
}
.profile-card .profile-role {
  color: var(--tn-gold);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.85rem;
}
.profile-card .profile-bio {
  color: var(--tn-gray);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 1rem;
}
.profile-card .profile-creds {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: #444;
}
.profile-card .profile-creds li {
  padding: 0.2rem 0;
}
.profile-card .profile-creds i {
  color: var(--tn-gold);
  margin-right: 0.4rem;
}
.profile-card .profile-action {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 6px;
}
.profile-card .profile-action img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  transition: transform 0.4s;
}
.profile-card .profile-action:hover img {
  transform: scale(1.08);
}
.profile-card .profile-action-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, transparent, rgba(13,27,42,0.85));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 1rem 0.5rem 0.5rem;
  text-align: center;
}

/* ---------- ABOUT / SPLIT SECTION ---------- */
.split-img {
  border-radius: 8px;
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* ---------- STATS STRIP ---------- */
.stats-strip {
  background: var(--tn-navy-2);
  color: #fff;
  padding: 3rem 0;
}
.stat-num {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--tn-gold);
  line-height: 1;
}
.stat-label {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.8);
  margin-top: 0.4rem;
}

/* ---------- CTA BAR ---------- */
.cta-bar {
  background: linear-gradient(135deg, var(--tn-gold), var(--tn-gold-bright));
  color: var(--tn-navy);
  padding: 3rem 0;
  text-align: center;
}
.cta-bar h3 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

/* ---------- CONTACT FORM ---------- */
.contact-form .form-control,
.contact-form .form-select {
  padding: 0.85rem 1rem;
  border-radius: 4px;
  border: 1px solid #d4d4d4;
  font-size: 1rem;
}
.contact-form .form-control:focus,
.contact-form .form-select:focus {
  border-color: var(--tn-gold);
  box-shadow: 0 0 0 0.2rem rgba(212, 169, 44, 0.2);
}
.contact-info-card {
  background: var(--tn-navy);
  color: #fff;
  border-radius: 8px;
  padding: 2rem;
  height: 100%;
}
.contact-info-card .info-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.contact-info-card .info-row i {
  font-size: 1.4rem;
  color: var(--tn-gold);
  flex-shrink: 0;
  margin-top: 0.2rem;
}
.contact-info-card .info-row a {
  color: #fff;
  text-decoration: none;
}
.contact-info-card .info-row a:hover {
  color: var(--tn-gold);
}

/* ---------- FOOTER ---------- */
footer {
  background: #08111c;
  color: rgba(255,255,255,0.7);
  padding: 3rem 0 1.5rem;
}
footer h5 {
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}
footer .footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  margin-bottom: 0.85rem;
}
footer .footer-brand .footer-logo {
  height: 40px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}
footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  display: block;
  padding: 0.3rem 0; /* a little more vertical room for finger taps */
  transition: color 0.2s;
}
footer a:hover { color: var(--tn-gold); }
footer .footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 2rem;
  padding-top: 1.5rem;
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- SCROLL REVEAL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- MOBILE-FRIENDLY OVERRIDES ---------- */
img { max-width: 100%; height: auto; } /* never overflow viewport */
iframe { max-width: 100%; }
.container { padding-left: 1rem; padding-right: 1rem; }

/* Make every tappable CTA at least 44x44 (Apple HIG / WCAG 2.5.5) */
.btn, .nav-link, .navbar-toggler {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-link { min-height: 44px; }

/* Tablets and below */
@media (max-width: 991.98px) {
  .navbar-tn .navbar-collapse {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .navbar-tn .nav-link { padding: 0.75rem 0.5rem !important; }
  .navbar-cta { margin-left: 0; margin-top: 0.5rem; width: 100%; text-align: center; }
}

/* Phones */
@media (max-width: 768px) {
  .hero { min-height: 70vh; padding: 4.5rem 1rem; }
  .hero-page { min-height: 30vh; padding: 3rem 1rem; }
  .section { padding: 3rem 0; }
  .stat-num { font-size: 2.25rem; }
  .stats-strip { padding: 2.25rem 0; }
  .cta-bar { padding: 2.25rem 0; }
  .cta-bar h3 { font-size: 1.3rem; }
  .cta-bar .btn { display: block; margin: 0.5rem auto; max-width: 320px; }
  .cta-bar .btn + .btn { margin-top: 0.5rem; }
  .split-img { min-height: 240px; }
  .service-card .service-img { height: 180px; }
  .contact-info-card { padding: 1.5rem; }
  footer { text-align: center; padding: 2.5rem 0 1.25rem; }
  footer .footer-brand { justify-content: center; }
  footer .row > div { margin-bottom: 0.5rem; }
}

/* Small phones */
@media (max-width: 480px) {
  .hero h1 br { display: none; } /* let title wrap naturally instead of forcing line break */
  .hero { padding: 4rem 0.75rem; }
  .section-title { font-size: 1.6rem; }
  .value-card, .service-card .service-body { padding: 1.25rem; }
  .cta-bar .btn-lg { padding: 0.7rem 1.25rem; font-size: 1rem; }
}

/* Respect reduced-motion preference (also helps perceived perf on phones) */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .service-card:hover, .value-card:hover, .profile-card:hover { transform: none; }
}
