/**
 * @file        tools.css
 * @description Styles and CSS animations for Tools detail pages (shared by every tool via includes/tool-detail.php)
 *
 * @author      Thomas Dobler - SYNTHETIXMIND LTD
 * @email       tom@synthetixmind.com
 * @company     SYNTHETIXMIND LTD, Paphos, Cyprus
 * @url         https://synthetixmind.com
 *
 * @uid         6a9f2d14-c873-4b5e-a01d-8e4b7c3f5d29
 * @version     0.1.1.4
 * @created     2026-10-23
 * @updated     2026-10-24
 *
 * @copyright   (c) 2026 by SYNTHETIXMIND LTD
 * @license     Proprietary — All rights reserved
 */

/* WHY: animations run even when the OS asks for reduced motion — owner decision
 *      (2026-10-23, same as marketing-lifecycle.js), so there are no
 *      prefers-reduced-motion overrides in this file. */

/* ---- Keyframes ---- */
@keyframes tool-rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes tool-pop {
  0%   { opacity: 0; transform: scale(0.6); }
  70%  { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes tool-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-10px) rotate(-2deg); }
}
@keyframes tool-pulse {
  0%   { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}
@keyframes tool-drift {
  0%, 100% { transform: translate(-10%, -5%) scale(1); }
  50%      { transform: translate(10%, 8%) scale(1.15); }
}
@keyframes tool-shine {
  0%, 60% { transform: translateX(-120%) skewX(-20deg); }
  100%    { transform: translateX(220%) skewX(-20deg); }
}
@keyframes tool-draw {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}
@keyframes tool-swap {
  0%, 15%   { opacity: 0; transform: translateX(-12px); }
  25%, 85%  { opacity: 1; transform: translateX(0); }
  100%      { opacity: 0; transform: translateX(12px); }
}

.tool-rise {
  opacity: 0;
  animation: tool-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--delay, 0s) forwards;
}

/* ---- Hero ---- */
.tool-hero {
  position: relative;
  overflow: hidden;
}
.tool-hero__glow {
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(circle at 30% 40%, rgba(250, 88, 0, 0.28), transparent 45%),
    radial-gradient(circle at 70% 60%, rgba(234, 221, 211, 0.12), transparent 40%);
  animation: tool-drift 14s ease-in-out infinite;
  pointer-events: none;
}
.tool-hero__inner { position: relative; }

.tool-breadcrumb {
  font-size: 0.9rem;
  color: rgba(234, 221, 211, 0.7);
  margin-bottom: var(--space-lg);
}
.tool-breadcrumb a { color: var(--color-beige); text-decoration: underline; text-underline-offset: 3px; }
.tool-breadcrumb a:hover { color: var(--color-orange); }

.tool-hero__logo {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto var(--space-md);
}
.tool-hero__logo img {
  position: relative;
  z-index: 1;
  width: 112px;
  height: 112px;
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  animation: tool-float 5s ease-in-out infinite;
}
.tool-hero__logo::before,
.tool-hero__logo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 28px;
  border: 2px solid var(--color-orange);
  animation: tool-pulse 2.8s ease-out infinite;
}
.tool-hero__logo::after { animation-delay: 1.4s; }

.tool-hero .subhead {
  max-width: 720px;
  margin: 0 auto var(--space-md);
}

.tool-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  padding: 0;
  margin: 0 0 var(--space-lg);
}
.tool-tag {
  opacity: 0;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(234, 221, 211, 0.35);
  color: var(--color-beige);
  font-size: 0.85rem;
  font-weight: 600;
  animation: tool-pop 0.5s ease-out var(--delay, 0s) forwards;
}
.tool-tag--primary {
  background: var(--color-orange);
  border-color: var(--color-orange);
  color: #fff;
}

.tool-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 0 0 var(--space-lg);
}
.tool-meta > div {
  min-width: 120px;
  padding: 0.6rem 1.1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.tool-meta dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(234, 221, 211, 0.7);
}
.tool-meta dd {
  margin: 0;
  font-weight: 700;
  color: #fff;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}
.tool-actions--left { justify-content: flex-start; }

.tool-download {
  position: relative;
  overflow: hidden;
  gap: 0.5rem;
}
.tool-download::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: tool-shine 3.2s ease-in-out infinite;
}
.tool-download svg { transition: transform 0.2s ease; }
.tool-download:hover svg { transform: translateY(3px); }

.tool-secondary {
  color: var(--color-beige);
  border-color: rgba(234, 221, 211, 0.5);
}
.tool-secondary:hover { color: var(--color-navy); }

/* ---- Sections ---- */
.tool-section { padding: var(--space-xl) 0; }
.tool-section--alt { background: var(--color-beige); }
.tool-heading { text-align: center; margin-bottom: var(--space-lg); }
.tool-narrow { max-width: 820px; }
.tool-summary {
  font-size: 1.1rem;
  line-height: 1.75;
  color: #374151;
  margin-bottom: var(--space-md);
}
.tool-section code,
.tool-scene code {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(250, 88, 0, 0.1);
  color: var(--color-mahogany);
}

/* Scroll reveal — hidden state only applies once the reveal script is running */
.tool-reveal-ready .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease var(--delay, 0s), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--delay, 0s);
}
.tool-reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---- Live demo scene ---- */
.tool-scene {
  position: relative;
  margin: 0 auto;
  max-width: 960px;
  height: 440px;
  border-radius: 20px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, #2a3f4e 0%, var(--color-navy) 70%);
  box-shadow: 0 24px 60px rgba(28, 44, 55, 0.35);
}
.tool-scene canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}
.tool-scene figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(234, 221, 211, 0.85);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.45));
}
.tool-scene__fallback {
  position: absolute;
  inset: 0 0 3rem;
  display: grid;
  place-items: center;
}
.tool-scene__pair {
  grid-area: 1 / 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0 1rem;
  font-size: 1.15rem;
  color: #fff;
  opacity: 0;
  animation: tool-swap 9s ease-in-out infinite;
}
.tool-scene__pair:nth-child(2) { animation-delay: 3s; }
.tool-scene__pair:nth-child(3) { animation-delay: 6s; }
.tool-scene__pair code { font-size: 1.15rem; background: rgba(250, 88, 0, 0.2); color: var(--color-orange); }
.tool-scene__arrow { color: var(--color-orange); font-weight: 700; }
.tool-scene.is-3d .tool-scene__fallback { display: none; }

/* ---- Key features ---- */
.tool-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}
.tool-feature {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border-top: 4px solid var(--color-orange);
  box-shadow: 0 4px 14px rgba(28, 44, 55, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.tool-feature:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(28, 44, 55, 0.14);
}
.tool-feature__num {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 1.6rem;
  font-weight: 700;
  color: rgba(250, 88, 0, 0.18);
}
.tool-feature h3 {
  font-size: 1.1rem;
  color: var(--color-navy);
  margin-bottom: 0.4rem;
}
.tool-feature p { font-size: 0.95rem; color: #4b5563; margin: 0; }

/* ---- Benefits ---- */
.tool-benefits {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 960px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-md) var(--space-lg);
}
.tool-benefit {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  color: #374151;
  line-height: 1.6;
}
.tool-benefit strong { color: var(--color-navy); }
.tool-benefit__check {
  flex-shrink: 0;
  color: var(--color-orange);
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}
.tool-benefit.is-visible .tool-benefit__check,
html:not(.tool-reveal-ready) .tool-benefit__check {
  animation: tool-draw 0.8s ease-out calc(var(--delay, 0s) + 0.3s) forwards;
}

/* ---- Download card ---- */
.tool-section--download { background: var(--color-beige); }
.tool-download-card {
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
  max-width: 860px;
  margin: 0 auto;
  padding: var(--space-lg);
  border-radius: 20px;
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-mahogany) 100%);
  color: var(--color-beige);
  box-shadow: 0 24px 60px rgba(28, 44, 55, 0.3);
}
.tool-download-card__logo {
  flex-shrink: 0;
  border-radius: 16px;
  animation: tool-float 5s ease-in-out infinite;
}
.tool-download-card h2 { color: #fff; margin-bottom: var(--space-md); }
.tool-meta--dark { justify-content: flex-start; }
.tool-download-card__file { font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--color-beige); }
.tool-download-card__note {
  font-size: 0.85rem;
  color: rgba(234, 221, 211, 0.75);
  margin-bottom: var(--space-md);
}

/* SHA-256 checksum block in the download card */
.tool-hash {
  margin-bottom: var(--space-md);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}
.tool-hash__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(234, 221, 211, 0.7);
  margin-bottom: 0.35rem;
}
.tool-hash__label a { color: var(--color-orange); text-transform: none; letter-spacing: 0; }
.tool-download-card .tool-hash__value {
  display: block;
  font-size: 0.8rem;
  line-height: 1.5;
  word-break: break-all;
  background: transparent;
  color: #fff;
  padding: 0;
}
.tool-hash__hint { font-size: 0.8rem; color: rgba(234, 221, 211, 0.75); margin: 0.5rem 0 0; }
.tool-download-card .tool-hash__hint code { background: rgba(250, 88, 0, 0.18); color: var(--color-beige); word-break: break-all; }

/* ---- Mobile ---- */
@media (max-width: 768px) {
  .tool-scene { height: 340px; border-radius: 14px; }
  .tool-benefits { grid-template-columns: 1fr; }
  .tool-download-card { flex-direction: column; align-items: center; text-align: center; padding: var(--space-lg) var(--space-md); }
  .tool-meta--dark,
  .tool-actions--left { justify-content: center; }
}

@media (max-width: 480px) {
  .tool-actions .btn { width: 100%; justify-content: center; }
  .tool-meta > div { min-width: 0; flex: 1 1 30%; padding: 0.5rem 0.6rem; }
  .tool-features { grid-template-columns: 1fr; }
}
