/* ==========================================================================
   ICR Science — Typography, Motion & Layout Helpers
   Font Stack from viethanagri.vn: SVN Avant Garde (Display) + SF Pro (Body)
   ========================================================================== */

@font-face {
  font-family: "SVN Avant Garde";
  src: url("../fonts/avant-garde-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SVN Avant Garde";
  src: url("../fonts/avant-garde-demi.woff2") format("woff2");
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SF Pro";
  src: url("../fonts/sf-pro-var.woff2") format("woff2-variations"),
       url("../fonts/sf-pro-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SF Pro";
  src: url("../fonts/sf-pro-var-italic.woff2") format("woff2-variations"),
       url("../fonts/sf-pro-var-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --c-primary: #005a9a;
  --c-primary-deep: #004274;
  --c-primary-mid: #1a6fb0;
  --c-accent: #2e8b3b;
  --c-ink: #0f172a;
  --c-ink-soft: #475569;
  --c-paper: #f8fafc;
  --font-display: "SVN Avant Garde", "Century Gothic", "Futura", system-ui, sans-serif;
  --font-body: "SF Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--c-ink);
  background-color: #ffffff;
  overflow-x: clip;
}

main,
footer,
section {
  overflow-x: clip;
}

h1, h2, h3, h4,
header nav a,
.immutek-skew-badge,
[data-step-num],
[data-count] {
  font-family: var(--font-display);
  font-synthesis: none;
}

h1:not([class*="tracking-wide"]),
h2:not([class*="tracking-wide"]),
h3:not([class*="tracking-wide"]),
h4:not([class*="tracking-wide"]) {
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.24;
  text-wrap: balance;
}

h1 em, h2 em {
  font-style: normal;
  color: #005a9a;
}

.bg-\[\#0b1f3a\] h1 em,
.bg-\[\#0b1f3a\] h2 em {
  color: #7dd3fc;
}

section.bg-slate-50 h1 em,
section.bg-white h1 em,
section.bg-slate-50 h2 em,
section.bg-white h2 em {
  color: #005a9a;
}

[data-count],
[data-step-num] {
  font-feature-settings: "tnum";
  letter-spacing: -0.02em;
}

p, li {
  text-wrap: pretty;
}

.font-serif-academic {
  font-family: var(--font-body);
}

/* --------------------------------------------------------------------------
   Motion Gate (VietHanAgri pattern: progressive enhancement + safe fallback)
   -------------------------------------------------------------------------- */
html.motion-ready [data-reveal]:not(.is-revealed),
html.motion-ready [data-reveal-group] > :not(.is-revealed) {
  opacity: 0;
}

html.motion-ready [data-reveal="mask"],
html.motion-ready [data-reveal="mask-left"],
html.motion-ready [data-reveal="circle"],
html.motion-ready [data-hero-item="media"] {
  opacity: 1;
}

html.motion-ready .is-revealed,
.is-revealed {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  html.motion-ready [data-reveal],
  html.motion-ready [data-reveal-group] > *,
  html.motion-ready [data-hero-item] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
  .marquee__track,
  .ticker-track,
  .phonering-circle,
  .phonering-circle-fill {
    animation: none !important;
  }
}

/* Word-by-word masked reveal wrapper (.w > span) */
.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-top: 0.24em;
  margin-top: -0.24em;
  padding-bottom: 0.18em;
  margin-bottom: -0.18em;
  padding-inline: 0.04em;
  margin-inline: -0.04em;
}

.w > span {
  display: inline-block;
  will-change: transform;
}

/* --------------------------------------------------------------------------
   Header & Navigation (Smart scroll hide/show + smooth dropdowns)
   -------------------------------------------------------------------------- */
.site-header {
  transition: transform 0.38s var(--ease-out), background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.14);
}

.site-header.is-hidden {
  transform: translateY(-100%);
}

.nav-dropdown-panel {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out), visibility 0.25s;
}

.nav-item.is-open > .nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-sub-panel {
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out), visibility 0.22s;
}

.nav-sub-item:hover > .nav-sub-panel,
.nav-sub-item:focus-within > .nav-sub-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* W3C-valid CSS announcement ticker (replaces deprecated <marquee>) */
.ticker-wrap {
  overflow: hidden;
  position: relative;
}

.ticker-track {
  display: inline-flex;
  white-space: nowrap;
  gap: 3rem;
  animation: ticker-scroll 26s linear infinite;
}

.ticker-wrap:hover .ticker-track {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* --------------------------------------------------------------------------
   Immutek Skewed Section Title + Double Divider
   -------------------------------------------------------------------------- */
.immutek-section-title {
  position: relative;
  text-align: center;
}

.immutek-section-title::before {
  content: "";
  display: block;
  border-top: 3px double var(--c-primary-mid);
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  z-index: 0;
}

.immutek-skew-badge {
  position: relative;
  z-index: 1;
  display: inline-block;
  max-width: calc(100% - 1.5rem);
  background: linear-gradient(135deg, #004274 0%, #005a9a 100%);
  color: #ffffff;
  padding: 0.5rem 1.25rem;
  transform: skew(-16deg);
  box-shadow: 0 8px 20px -6px rgba(0, 90, 154, 0.35);
}

.immutek-skew-badge > span {
  display: inline-block;
  transform: skew(16deg);
}

@media (min-width: 640px) {
  .immutek-skew-badge {
    padding: 0.55rem 2rem;
    transform: skew(-24deg);
  }
  .immutek-skew-badge > span {
    transform: skew(24deg);
  }
}

/* --------------------------------------------------------------------------
   Decorative Sun Arc & Scientific Orbit SVG Lines (VietHanAgri signature)
   -------------------------------------------------------------------------- */
.sun-arc {
  pointer-events: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.sun-arc path {
  vector-effect: non-scaling-stroke;
}

.orbit-spin {
  animation: orbit-rotate 48s linear infinite;
  transform-origin: center;
}

@keyframes orbit-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   Organic Media Masks, Zoom Hover & Service Card Gradient Label (Immutek)
   -------------------------------------------------------------------------- */
.media--arch {
  border-radius: 999px 999px 18px 18px;
  overflow: hidden;
}

.media--circle {
  border-radius: 9999px;
  overflow: hidden;
}

.zoom-hover img {
  transition: transform 0.9s var(--ease-out);
  will-change: transform;
}

.group:hover .zoom-hover img,
.zoom-hover:hover img {
  transform: scale(1.06);
}

.immutek-card-banner {
  background-image: linear-gradient(90deg, rgba(0, 90, 154, 0.08) 0%, rgba(0, 90, 154, 0.90) 18%, rgba(0, 66, 116, 0.94) 82%, rgba(0, 90, 154, 0.08) 100%);
}

/* --------------------------------------------------------------------------
   Sticky Storytelling Steps (VietHanAgri 3-step section)
   -------------------------------------------------------------------------- */
.story-media {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.6s var(--ease-out), transform 0.8s var(--ease-out);
}

.story-media.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.story-step {
  opacity: 0.45;
  transition: opacity 0.35s ease, border-color 0.35s ease, transform 0.35s var(--ease-out);
}

.story-step.is-active {
  opacity: 1;
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Credentials Infinite Marquee (VietHanAgri)
   -------------------------------------------------------------------------- */
.marquee {
  overflow: hidden;
  user-select: none;
}

.marquee__track {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 2.5rem;
  animation: marquee-run 34s linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

@keyframes marquee-run {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* --------------------------------------------------------------------------
   Bar Chart Fill (VietHanAgri proof section)
   -------------------------------------------------------------------------- */
[data-bar] {
  transform-origin: left center;
}

/* --------------------------------------------------------------------------
   Floating Phone Ring Pulse (Immutek signature)
   -------------------------------------------------------------------------- */
.phonering-circle {
  animation: phonering-pulse 1.8s ease-out infinite;
}

@keyframes phonering-pulse {
  0% {
    transform: scale(0.85);
    opacity: 0.8;
  }
  70% {
    transform: scale(1.45);
    opacity: 0;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   Hero Slide Transitions
   -------------------------------------------------------------------------- */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.42s var(--ease-out), visibility 0.42s;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   Focus Ring Accessibility
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid #38a138;
  outline-offset: 2px;
}
