/* ═══════════════════════════════════════════════════════════
   TIHANTECH — Main stylesheet  v1.2
   Design tokens
     Navy:   #0B2042   trust / header
     Teal:   #00C4A7   accent / highlights
     Surface:#F6F8FB   off-white page background
     Text:   #121B2A   near-black body
   ═══════════════════════════════════════════════════════════ */

:root {
  --tt-navy:    #0B2042;
  --tt-teal:    #00C4A7;
  --tt-teal-d:  #008F7A;
  --tt-surface: #F6F8FB;
  --tt-dark:    #121B2A;
  --tt-muted:   #6B7A8D;
  --tt-border:  #DDE3ED;
  --tt-radius:  10px;
  --tt-tab-h:   46px;
  --tt-nav-h:   60px;
  --transition: .22s ease;
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--tt-dark);
  background: var(--tt-surface);
  font-size: 16px;
  line-height: 1.7;
}
h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; }
a { color: var(--tt-teal-d); transition: color var(--transition); }
a:hover { color: var(--tt-navy); }
img { max-width: 100%; height: auto; }

/* ── Top navigation bar ──────────────────────────────────── */
#tt-navbar {
  height: var(--tt-nav-h);
  background: var(--tt-navy);
  border-bottom: 2px solid rgba(255,255,255,.06);
  position: sticky;
  top: 0;
  z-index: 1030;
  transition: box-shadow var(--transition);
}
#tt-navbar.scrolled { box-shadow: 0 2px 20px rgba(11,32,66,.4); }
.tt-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.5px;
}
.tt-brand span { color: var(--tt-teal); }
.tt-brand:hover { color: #fff; text-decoration: none; }

/* ── Sticky section tab bar ──────────────────────────────── */
/* display:flex + justify-content:center here handles centering
   so it works regardless of any inner wrapper Bootstrap classes. */
#tt-tabs-bar {
  height: var(--tt-tab-h);
  background: var(--tt-navy);
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky;
  top: var(--tt-nav-h);
  z-index: 1020;
  overflow-x: auto;
  scrollbar-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
#tt-tabs-bar::-webkit-scrollbar { display: none; }
#tt-tabs-bar .tt-tab {
  height: var(--tt-tab-h);
  padding: 0 18px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
#tt-tabs-bar .tt-tab:hover  { color: rgba(255,255,255,.85); }
#tt-tabs-bar .tt-tab.active { color: var(--tt-teal); border-bottom-color: var(--tt-teal); }

/* ── Hero ────────────────────────────────────────────────── */
#section-hero {
  min-height: 88vh;
  background: linear-gradient(135deg, var(--tt-navy) 0%, #143366 60%, #0d2e5a 100%);
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
}
#section-hero .hero-bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  opacity: .18;
  width: 100%;
  height: 100%;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,196,167,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,196,167,.06) 1px, transparent 1px);
  background-size: 48px 48px;
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block;
  padding: 4px 14px;
  border: 1px solid rgba(0,196,167,.4);
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--tt-teal);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}
.hero-heading {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  color: #fff;
  line-height: 1.15;
  margin-bottom: 1.2rem;
}
.hero-heading em { color: var(--tt-teal); font-style: normal; }
.hero-sub {
  color: rgba(255,255,255,.7);
  font-size: 1.1rem;
  max-width: 540px;
  margin-bottom: 2rem;
}
.tt-btn-primary {
  background: var(--tt-teal);
  color: var(--tt-navy);
  font-weight: 700;
  padding: .7rem 2rem;
  border-radius: 100px;
  border: 0;
  transition: transform var(--transition), box-shadow var(--transition);
  display: inline-block;
  text-decoration: none;
}
.tt-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,196,167,.35); color: var(--tt-navy); }
.tt-btn-outline {
  border: 2px solid rgba(255,255,255,.3);
  color: #fff;
  padding: .65rem 2rem;
  border-radius: 100px;
  background: transparent;
  transition: border-color var(--transition), background var(--transition);
  display: inline-block;
  text-decoration: none;
}
.tt-btn-outline:hover { border-color: var(--tt-teal); background: rgba(0,196,167,.08); color: #fff; }
.hero-stat { text-align: center; }
.hero-stat .num { font-family: 'Playfair Display', serif; font-size: 2.4rem; font-weight: 900; color: var(--tt-teal); }
.hero-stat .lbl { font-size: .78rem; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: 1px; }

/* ── Section base ────────────────────────────────────────── */
/* NO transform here — transforms shift getBoundingClientRect values
   and break the scrollspy threshold calculations. Fade with opacity only. */
.tt-section {
  padding: 80px 0;
  opacity: 0;
  transition: opacity .55s ease;
}
.tt-section.visible { opacity: 1; }
.tt-section:nth-child(even) { background: #fff; }
.tt-section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--tt-navy);
  margin-bottom: .4rem;
}
.tt-section-subtitle {
  color: var(--tt-muted);
  font-size: .95rem;
  margin-bottom: 2.8rem;
}
.tt-divider {
  width: 48px;
  height: 3px;
  background: var(--tt-teal);
  border-radius: 2px;
  margin: .6rem 0 2.2rem;
}

/* ── About ────────────────────────────────────────────────── */
.tt-about-card {
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  padding: 2rem;
  height: 100%;
  background: #fff;
  transition: box-shadow var(--transition), transform var(--transition);
}
.tt-about-card:hover { box-shadow: 0 6px 28px rgba(11,32,66,.1); transform: translateY(-3px); }
.tt-about-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(0,196,167,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--tt-teal-d);
  margin-bottom: 1rem;
}

/* ── Services ────────────────────────────────────────────── */
.tt-service-card {
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  padding: 2rem 1.6rem;
  height: 100%;
  background: #fff;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.tt-service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--tt-teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.tt-service-card:hover::before { transform: scaleX(1); }
.tt-service-card:hover { box-shadow: 0 8px 32px rgba(11,32,66,.1); transform: translateY(-4px); }
.tt-service-icon { font-size: 2.2rem; color: var(--tt-teal-d); margin-bottom: .9rem; display: block; }

/* ── Projects ────────────────────────────────────────────── */
.tt-project-card {
  border-radius: var(--tt-radius);
  overflow: hidden;
  border: 1px solid var(--tt-border);
  background: #fff;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}
.tt-project-card:hover { box-shadow: 0 8px 32px rgba(11,32,66,.12); transform: translateY(-4px); }
.tt-project-img { aspect-ratio: 16/9; object-fit: cover; width: 100%; display: block; }
.tt-project-body { padding: 1.3rem; }
.tt-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  background: rgba(0,196,167,.1);
  color: var(--tt-teal-d);
  font-size: .75rem;
  font-weight: 600;
  margin: 2px;
}

/* ── Clients ─────────────────────────────────────────────── */
.tt-client-logo {
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  padding: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: box-shadow var(--transition);
  min-height: 90px;
}
.tt-client-logo:hover { box-shadow: 0 4px 18px rgba(11,32,66,.1); }
.tt-client-logo img { max-height: 56px; width: auto; filter: grayscale(60%); transition: filter var(--transition); }
.tt-client-logo:hover img { filter: none; }

/* ── Testimonials ────────────────────────────────────────── */
.tt-testimonial {
  border-radius: var(--tt-radius);
  border: 1px solid var(--tt-border);
  padding: 2rem;
  background: #fff;
  position: relative;
}
.tt-testimonial::before {
  content: '\201C';
  position: absolute;
  top: -8px; left: 20px;
  font-size: 5rem;
  font-family: 'Playfair Display', serif;
  color: var(--tt-teal);
  line-height: 1;
  opacity: .3;
}
.tt-stars { color: #F59E0B; font-size: .85rem; }
.tt-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--tt-teal);
}

/* ── Blog ─────────────────────────────────────────────────── */
.tt-blog-card {
  border-radius: var(--tt-radius);
  overflow: hidden;
  border: 1px solid var(--tt-border);
  background: #fff;
  transition: box-shadow var(--transition), transform var(--transition);
}
.tt-blog-card:hover { box-shadow: 0 6px 26px rgba(11,32,66,.1); transform: translateY(-3px); }
.tt-blog-img { aspect-ratio: 16/9; object-fit: cover; width: 100%; display: block; }
.tt-blog-body { padding: 1.4rem; }
.tt-cat-pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 100px;
  background: rgba(11,32,66,.07);
  color: var(--tt-navy);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.tt-blog-cat-tree { border-right: 1px solid var(--tt-border); }
.tt-blog-cat-tree .cat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: .45rem .8rem;
  border-radius: 8px;
  font-size: .88rem;
  cursor: pointer;
  transition: background var(--transition);
}
.tt-blog-cat-tree .cat-item:hover,
.tt-blog-cat-tree .cat-item.active { background: rgba(0,196,167,.1); color: var(--tt-teal-d); }
.tt-blog-cat-tree .sub-cat { padding-left: 1.6rem; font-size: .83rem; }

/* ── News / notices ───────────────────────────────────────── */
.tt-notice-row {
  border-left: 3px solid var(--tt-teal);
  padding: 1rem 1.4rem;
  background: #fff;
  border-radius: 0 var(--tt-radius) var(--tt-radius) 0;
  margin-bottom: 1rem;
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  cursor: pointer;
  transition: box-shadow var(--transition);
}
.tt-notice-row:hover { box-shadow: 0 4px 18px rgba(11,32,66,.08); }
.tt-notice-date { font-size: .78rem; color: var(--tt-muted); min-width: 80px; padding-top: 3px; }
.tt-badge-pill {
  padding: 2px 10px;
  border-radius: 100px;
  font-size: .73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.tt-badge-pill.news    { background: #DBEAFE; color: #1D4ED8; }
.tt-badge-pill.notice  { background: #FEF3C7; color: #92400E; }
.tt-badge-pill.update  { background: #DCFCE7; color: #166534; }
.tt-badge-pill.event   { background: #F3E8FF; color: #6B21A8; }

/* ── Contact ─────────────────────────────────────────────── */
.tt-map-frame {
  width: 100%;
  height: 360px;
  border-radius: var(--tt-radius);
  border: 0;
  display: block;
}
.tt-contact-form .form-control {
  border-radius: 8px;
  border-color: var(--tt-border);
  padding: .7rem 1rem;
}
.tt-contact-form .form-control:focus {
  border-color: var(--tt-teal);
  box-shadow: 0 0 0 3px rgba(0,196,167,.15);
}
.tt-contact-icon { font-size: 1.2rem; color: var(--tt-teal-d); }

/* ── Inline file / PDF viewer ────────────────────────────── */
.tt-inline-viewer { border: 1px solid var(--tt-border); border-radius: var(--tt-radius); overflow: hidden; }
.tt-inline-viewer iframe { width: 100%; height: 520px; display: block; border: 0; }
.tt-inline-viewer img { width: 100%; display: block; }
.tt-inline-viewer .tt-viewer-fallback { padding: 2rem; text-align: center; background: #fff; }

/* ── Modal ───────────────────────────────────────────────── */
.tt-modal .modal-dialog { max-width: 860px; }
.tt-modal .modal-body { max-height: 80vh; overflow-y: auto; }
.tt-gallery-thumb {
  width: 72px; height: 56px; object-fit: cover;
  border-radius: 6px; cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition);
}
.tt-gallery-thumb:hover,
.tt-gallery-thumb.active { border-color: var(--tt-teal); }

/* ── Back to top ─────────────────────────────────────────── */
#tt-back-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--tt-navy);
  color: var(--tt-teal);
  border: 0;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--transition), transform var(--transition), background var(--transition);
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(11,32,66,.25);
}
#tt-back-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
#tt-back-top:hover { background: var(--tt-teal); color: var(--tt-navy); }

/* ── Skeleton loader ─────────────────────────────────────── */
.tt-skeleton {
  background: linear-gradient(90deg, #e8ecf0 25%, #f4f6f8 50%, #e8ecf0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes skeleton-shimmer { to { background-position: -200% 0; } }

/* ── Spinner ─────────────────────────────────────────────── */
.tt-spinner { display: flex; align-items: center; justify-content: center; padding: 3rem; }
.tt-spinner-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--tt-teal);
  animation: tt-bounce .9s infinite ease-in-out both;
  margin: 0 4px;
}
.tt-spinner-dot:nth-child(2) { animation-delay: .15s; }
.tt-spinner-dot:nth-child(3) { animation-delay: .3s;  }
@keyframes tt-bounce { 0%,80%,100%{transform:scale(0)} 40%{transform:scale(1)} }

/* ── Error state ─────────────────────────────────────────── */
.tt-error { text-align: center; padding: 3rem; color: var(--tt-muted); }

/* ── Footer ──────────────────────────────────────────────── */
#tt-footer {
  background: var(--tt-navy);
  color: rgba(255,255,255,.6);
  padding: 40px 0 20px;
}
#tt-footer h6 { color: #fff; }
#tt-footer a { color: rgba(255,255,255,.55); font-size: .9rem; }
#tt-footer a:hover { color: var(--tt-teal); }
.tt-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 16px;
  margin-top: 24px;
  font-size: .82rem;
}
.tt-social-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.55);
  transition: background var(--transition), color var(--transition);
}
.tt-social-btn:hover { background: var(--tt-teal); border-color: var(--tt-teal); color: var(--tt-navy); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 767px) {
  .tt-section { padding: 52px 0; }
  .hero-heading { font-size: 2.1rem; }
  #tt-back-top { bottom: 18px; right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .tt-section { opacity: 1; transition: none; }
  .tt-skeleton { animation: none; background: #e8ecf0; }
}
