/*
 * Shared site styles: header, mobile drawer, footer and site-wide fixes.
 * Linked on every page AFTER the page's own <style>, so these rules win.
 * The header/footer markup itself is generated by _build/build.py.
 */

/* ---------- tokens ---------- */
:root {
  --text-dim: #64748b;          /* was #94a3b8 (2.6:1) — now 4.8:1 on white */
  --accent-cyan-text: #0e7490;  /* brand cyan for text; #06b6d4 stays for fills and icons */
  --site-ink: #1e293b;
  --site-muted: #475569;
  --site-line: rgba(15, 23, 42, 0.09);
  --site-grad: linear-gradient(135deg, #06b6d4, #2563eb);
}

/* ---------- site-wide fixes ---------- */
html { overflow-x: clip; }                 /* backstop against sideways panning on phones */
#preloader { display: none !important; }  /* the page is usable before every image has loaded */
@media (max-width: 767.98px) {
  /* Bootstrap's g-5/g-4 gutters are wider than the container padding on phones */
  .row.g-5, .row.g-4 { --bs-gutter-x: 1.5rem; }
}
.gradient-text { background-image: linear-gradient(135deg, #0891b2, #2563eb); }

/* Bigger tap targets on touch screens */
@media (max-width: 991.98px) {
  .breadcrumb-custom a, .service-link, .details-link { display: inline-flex; align-items: center; min-height: 40px; }
}

/* ---------- base ---------- */
.site-header a, .site-drawer a, .site-footer a { text-decoration: none; }

/* ---------- skip link ---------- */
.skip-link { position: absolute; top: -100px; left: 16px; z-index: 9999; background: #0e7490; color: #fff !important; padding: 8px 16px; border-radius: 0 0 8px 8px; font-weight: 600; font-size: 0.85rem; transition: top 0.2s; }
.skip-link:focus { top: 0; }

/* ---------- header ---------- */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding: 12px 0; background: rgba(255, 255, 255, 0.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--site-line); transition: box-shadow 0.3s ease, padding 0.3s ease; }
.site-header.scrolled { box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--site-ink) !important; white-space: nowrap; }
.site-brand img { width: 36px; height: 36px; object-fit: contain; }
.site-brand span span { color: #2563eb; }
.site-nav { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: inline-flex; align-items: center; min-height: 40px; color: var(--site-muted); font-size: 0.875rem; font-weight: 500; padding: 6px 12px; border-radius: 8px; transition: background 0.2s ease, color 0.2s ease; white-space: nowrap; }
.site-nav a:hover { color: var(--site-ink); background: rgba(6, 182, 212, 0.1); }
.site-nav a.active { color: #0e7490; background: rgba(6, 182, 212, 0.1); font-weight: 600; }
.site-nav .site-lang img { width: 26px; height: 18px; object-fit: cover; border-radius: 3px; display: block; }
.site-nav .site-cta { background: var(--site-grad); color: #fff !important; font-weight: 600; padding: 8px 18px; margin-left: 6px; box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3); }
.site-nav .site-cta:hover { background: var(--site-grad); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4); }
.site-menu-btn { display: none; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.site-menu-btn span { display: block; width: 24px; height: 2px; background: var(--site-ink); margin: 5px 0; border-radius: 2px; transition: transform 0.3s ease, opacity 0.3s ease; }
.site-menu-btn[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.site-menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.site-menu-btn[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
.site-menu-btn:focus-visible, .site-drawer a:focus-visible, .site-drawer-close:focus-visible, .site-nav a:focus-visible, .site-footer a:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
@media (max-width: 1199.98px) { .site-nav a { padding: 6px 9px; } }
@media (max-width: 991.98px) {
  .site-nav { display: none; }
  .site-menu-btn { display: block; }
}

/* ---------- mobile drawer ---------- */
.site-drawer-overlay { position: fixed; inset: 0; z-index: 1001; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(2px); }
.site-drawer-overlay[hidden] { display: none; }
.site-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(310px, 84vw); z-index: 1002; background: #fff; display: flex; flex-direction: column; box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15); transform: translateX(100%); visibility: hidden; transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.32s; }
.site-drawer.open { transform: translateX(0); visibility: visible; transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1); }
.site-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 14px 20px; border-bottom: 1px solid var(--site-line); }
.site-drawer-head .site-brand { font-size: 0.82rem; }
.site-drawer-head .site-brand img { width: 28px; height: 28px; }
.site-drawer-close { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: transparent; color: var(--site-muted); cursor: pointer; font-size: 1.1rem; }
.site-drawer-close:hover { background: #f5f7fb; color: var(--site-ink); }
.site-drawer-nav { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.site-drawer-nav a { font-size: 0.95rem; font-weight: 600; color: var(--site-muted); padding: 11px 14px; min-height: 44px; border-radius: 10px; display: flex; align-items: center; gap: 12px; }
.site-drawer-nav a:hover, .site-drawer-nav a.active { color: #0e7490; background: rgba(6, 182, 212, 0.08); }
.site-drawer-nav a i { width: 16px; text-align: center; font-size: 0.85rem; opacity: 0.7; }
.site-drawer-nav .site-lang { margin-top: 6px; border-top: 1px solid var(--site-line); border-radius: 0; padding-top: 14px; }
.site-drawer-nav .site-lang img { width: 18px; height: 13px; object-fit: cover; border-radius: 2px; }
.site-drawer-foot { padding: 14px 16px 28px; border-top: 1px solid var(--site-line); margin-top: auto; }
.site-drawer-foot a { display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; padding: 13px; border-radius: 10px; background: var(--site-grad); color: #fff !important; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .site-drawer, .site-drawer.open { transition: none; } }

/* ---------- footer ---------- */
.site-footer { background: #fff; border-top: 1px solid var(--site-line); padding: 60px 0 28px; color: var(--site-muted); }
.site-footer .site-brand { margin-bottom: 12px; }
.site-footer-desc { font-size: 0.85rem; color: var(--text-dim); line-height: 1.7; max-width: 280px; }
.site-footer-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--site-muted); margin-bottom: 10px; }
.site-footer-links { display: flex; flex-direction: column; list-style: none; padding: 0; margin: 0; }
.site-footer-links a { display: inline-flex; align-items: center; min-height: 36px; font-size: 0.87rem; color: var(--text-dim); transition: color 0.2s ease; }
.site-footer-links a:hover { color: #0e7490; }
.site-footer-contact { font-size: 0.87rem; color: var(--text-dim); line-height: 1.7; }
.site-footer-contact div { display: flex; gap: 10px; margin-bottom: 10px; }
.site-footer-contact i { color: #0e7490; margin-top: 5px; width: 14px; flex-shrink: 0; }
.site-footer-contact a { color: var(--text-dim); }
.site-footer-contact a:hover { color: #0e7490; }
.site-social { display: flex; gap: 10px; margin-top: 18px; }
.site-social a { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--site-line); display: flex; align-items: center; justify-content: center; color: var(--site-muted); transition: all 0.2s ease; }
.site-social a:hover { background: rgba(6, 182, 212, 0.1); border-color: rgba(6, 182, 212, 0.3); color: #0e7490; transform: translateY(-2px); }
.site-footer-bottom { border-top: 1px solid var(--site-line); margin-top: 40px; padding-top: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; font-size: 0.82rem; color: var(--text-dim); }
.site-footer-bottom nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-footer-bottom a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; color: var(--text-dim); }
.site-footer-bottom a:hover { color: #0e7490; }
.site-footer-bottom img { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; }

/* ---------- back to top ---------- */
.site-top { position: fixed; bottom: 100px; right: 30px; z-index: 990; width: 44px; height: 44px; border-radius: 12px; background: var(--site-grad); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35); opacity: 0; transform: translateY(12px); transition: opacity 0.3s ease, transform 0.3s ease; pointer-events: none; }
.site-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
@media (max-width: 480px) { .site-top { bottom: 84px; right: 22px; } }

/* ---------- small-text contrast and touch targets on older page styles ---------- */
.skill-tag { color: #4338ca; }
.badge-open { color: #047857; }
.badge-hot { color: #c2410c; }
.site-footer-contact a, .apply-note a { display: inline-block; padding: 8px 0; }
@media (max-width: 991.98px) {
  .page-hero > .container > nav a { display: inline-flex; align-items: center; min-height: 40px; }
}

/* ---------- motion: homepage hero (see assets/js/hero.js) ---------- */
@keyframes site-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes site-pop { from { opacity: 0; transform: translateX(26px) scale(0.97); } to { opacity: 1; transform: none; } }
/* "backwards" fill: the start state applies during the delay, and hover transforms still work afterwards */
[data-rise] { animation: site-rise 0.8s cubic-bezier(0.2, 0.75, 0.25, 1) backwards; animation-delay: calc(120ms + var(--i, 0) * 110ms); }
[data-pop] { animation: site-pop 0.7s cubic-bezier(0.2, 0.75, 0.25, 1) backwards; animation-delay: calc(550ms + var(--i, 0) * 120ms); }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.4s ease; }
.hero-canvas.on { opacity: 1; }
.word-rotator { display: inline-block; transition: opacity 0.38s ease, transform 0.38s ease, filter 0.38s ease; }
.word-rotator.is-out { opacity: 0; transform: translateY(-0.3em); filter: blur(4px); }
.word-rotator.is-in { opacity: 0; transform: translateY(0.3em); filter: blur(4px); transition: none; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.75, 0.25, 1); }
.reveal.revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-rise], [data-pop] { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- motion: delivery-process pipeline (see assets/js/hero.js) ---------- */
.steps-track { position: relative; display: flex; justify-content: space-between; align-items: center; max-width: 880px; margin: -8px auto 40px; padding: 0 2px; }
.steps-track::before, .steps-track-fill { content: ''; position: absolute; left: 17px; top: 50%; height: 3px; border-radius: 3px; transform: translateY(-50%); }
.steps-track::before { right: 17px; background: rgba(15, 23, 42, 0.08); }
.steps-track-fill { width: 0; background: linear-gradient(90deg, #06b6d4, #2563eb); transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1); }
.steps-dot { position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 2px solid rgba(15, 23, 42, 0.12); display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 800; color: #64748b; transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease; }
.steps-dot.done { border-color: #06b6d4; color: #0e7490; }
.steps-dot.active { background: linear-gradient(135deg, #06b6d4, #2563eb); border-color: transparent; color: #fff; transform: scale(1.15); box-shadow: 0 0 0 6px rgba(6, 182, 212, 0.16); }
.process-step { transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease; }
.process-step.is-active { border-color: rgba(6, 182, 212, 0.5) !important; box-shadow: 0 14px 36px rgba(6, 182, 212, 0.16); transform: translateY(-4px); }
.process-step.is-active .step-num { animation: step-pulse 1.6s ease-out infinite; }
@keyframes step-pulse { from { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.4); } to { box-shadow: 0 0 0 14px rgba(6, 182, 212, 0); } }
@media (prefers-reduced-motion: reduce) {
  .steps-track-fill, .steps-dot, .process-step { transition: none; }
  .process-step.is-active .step-num { animation: none; }
}
.steps-track--aligned { display: block; max-width: none; height: 34px; padding: 0; }
.steps-track--aligned .steps-dot { position: absolute; top: 0; }
.steps-track--aligned::before { left: var(--first); right: auto; width: var(--span); }
