/* ==========================================================================
   Tool Zino — Polish Layer
   Stylish typography, refined micro-interactions, section reveal animation.
   Loaded AFTER responsive.css on every page — additive only, no overrides
   of core layout so it's safe across all 32 pages.
   ========================================================================== */

/* ---- Typography: crisper rendering + refined tracking ---- */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-feature-settings: "liga" 1, "kern" 1, "calt" 1;
  letter-spacing: 0.005em;
}

h1, h2, h3, h4,
.tz-hero h1,
.tool-card h3,
.cat-card h3 {
  letter-spacing: -0.02em;
}

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.14em !important;
  text-transform: uppercase;
}

/* Selection color to match brand */
::selection { background: var(--color-primary); color: #fff; }

/* Slightly refined paragraph rhythm */
p { line-height: 1.7; }

/* ---- Animated gradient text utility (opt-in via .grad, already used in hero) ---- */
.tz-hero h1 .grad,
.grad-anim {
  background: var(--gradient-primary);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: tzGradFlow 6s ease-in-out infinite;
}

@keyframes tzGradFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ---- Section reveal-on-scroll (driven by assets/js/polish.js) ---- */
.tz-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease-out, cubic-bezier(0.16,1,0.3,1)),
              transform 0.7s var(--ease-out, cubic-bezier(0.16,1,0.3,1));
  will-change: opacity, transform;
}
.tz-reveal.tz-in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .tz-reveal { opacity: 1; transform: none; transition: none; }
}

/* ---- Card micro-interactions: lift, glow, icon nudge ---- */
.tool-card,
.cat-card {
  transition: transform 0.4s var(--ease-out, cubic-bezier(0.16,1,0.3,1)),
              box-shadow 0.4s var(--ease-out, cubic-bezier(0.16,1,0.3,1)),
              border-color 0.4s ease;
}
.tool-card:hover,
.cat-card:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 20px 45px rgba(79, 70, 229, 0.18);
}
.tool-card:hover i,
.cat-card:hover i {
  transform: translateY(-2px) scale(1.08);
  transition: transform 0.35s var(--ease-out, cubic-bezier(0.16,1,0.3,1));
}
.tool-card i,
.cat-card i {
  transition: transform 0.35s var(--ease-out, cubic-bezier(0.16,1,0.3,1));
}

/* ---- Button shine sweep on hover ---- */
.btn-primary-tz {
  position: relative;
  overflow: hidden;
}
.btn-primary-tz::after {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s ease;
}
.btn-primary-tz:hover::after { left: 130%; }

/* ---- Nav link underline sweep ---- */
.tz-header nav a,
.tz-header-right nav a {
  position: relative;
}
.tz-header nav a::after,
.tz-header-right nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 2px;
  background: var(--gradient-primary);
  transition: width 0.35s var(--ease-out, cubic-bezier(0.16,1,0.3,1));
  border-radius: 2px;
}
.tz-header nav a:hover::after,
.tz-header-right nav a:hover::after { width: 100%; }

/* ---- Timeline dot pulse (about page) ---- */
.tz-timeline-dot {
  animation: tzPulse 2.4s ease-in-out infinite;
}
@keyframes tzPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(79, 70, 229, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .tz-timeline-dot { animation: none; }
  .grad-anim, .tz-hero h1 .grad { animation: none; }
}
