/* Custom animations and styles for vanilla JS version */

/* Font Variables - Change these to instantly update all accent fonts */
:root {
  --font-accent: 'SF Mono', 'Monaco', 'Consolas', 'Liberation Mono', monospace;
  --font-body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: Impact, 'Arial Black', sans-serif;

  /* Product Button Variables */
  --product-btn-bg: #0cb2ff;
  --product-btn-bg-hover: #48ff06;
  --product-btn-alignment: center;
  /* left, center, or right */

  --construction-btn-bg: #fbbf24;
  /* Amber-400 */
  --construction-btn-bg-hover: #f59e0b;
  /* Amber-500 */
}

/* Absolute positioning for bottom-right buttons */
.relative-card {
  position: relative !important;
  padding-bottom: 60px !important;
  /* Make room for absolute button */
}

.absolute-bottom-btn {
  position: absolute !important;
  bottom: 0px !important;
  right: 18px !important;
  width: auto !important;
}

/* Global font override */
body {
  font-family: var(--font-body) !important;
}

.font-accent {
  font-family: var(--font-accent) !important;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-accent) !important;
}

/* Fallback for browsers that don't support margin-inline */
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* Diagram node animations */
.diagram-node {
  transition: none;
}

.diagram-node.active {
  /* Nodes stay in place, only pulse effect visible */
}

.diagram-node .node-icon {
  transition: none;
}

.diagram-node.active .node-icon {
  /* No wiggle animation */
}

/* Pulse effect animation */
.pulse-effect {
  animation: pulse-grow 1s infinite;
}

@keyframes pulse-grow {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* SVG line animation */
.diagram-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  transition: stroke-dashoffset 1.5s ease;
}

/* Smooth transitions for mobile menu */
#mobile-menu {
  max-height: 0;
  transition: max-height 0.3s ease-out;
  overflow: hidden;
}

#mobile-menu:not(.hidden) {
  max-height: 500px;
}

/* Telemetry panel slide animation */
#telemetry-panel {
  max-height: 0;
  transition: max-height 0.2s ease-out;
}

#telemetry-panel:not(.hidden) {
  max-height: 400px;
}

#telemetry-content {
  font-family: var(--font-accent);
}

/* Blog cards: light, thin border */
.blog-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

/* Companion product cards */
.companion-card {
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.companion-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.companion-card .companion-price {
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: 0.95rem;
  color: #111827;
  letter-spacing: 0.04em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Brand lockup */
.brand-image-wrap {
  display: inline-flex;
  align-items: center;
  padding: 6px;
}

.brand-image {
  max-height: 80px;
  width: auto;
  display: block;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 2px solid #000;
  background: #f5f7f7;
  text-decoration: none;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border: 2px solid #000;
  border-radius: 50%;
  position: relative;
  background: #fff;
  display: inline-block;
}

.brand-icon-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #e10600;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.brand-icon-cross {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 2px;
  background: #000;
  transform: translate(-50%, -50%);
}

.brand-icon-cross::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 28px;
  background: #000;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: Impact, 'Arial Black', sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-subtitle {
  font-family: var(--font-accent);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #222;
}

/* MRE-style navigation */
.mre-nav {
  position: relative;
  padding-top: 28px;
  padding-bottom: 10px;
}

.mre-nav-links {
  position: relative;
  display: flex;
  gap: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.mre-stripes {
  position: absolute;
  top: -13px;
  right: 0;
  display: flex;
  gap: 53px;
  pointer-events: none;
}

.mre-stripe {
  width: 46px;
  height: 14px;
  background: #000;
  transform: skewX(30deg);
}

.nav-link {
  padding: 6px 4px 2px;
  font-family: Impact, 'Arial Black', sans-serif;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: #e10600;
}

/* Soft shadow used on tool cards (tools page) */
.card-shadow {
  box-shadow: 8px 8px 0 0 rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease;
}

.card-shadow:hover {
  box-shadow: 8px 8px 0 0 rgba(0, 0, 0, 0.2);
}

/* Mobile stripe separator */
.mobile-stripe {
  height: 14px;
  background: linear-gradient(-30deg,
      #000 0 28%,
      transparent 28% 50%,
      #000 50% 78%,
      transparent 78% 100%);
  margin: 0 1.5rem 0.5rem;
}

/* Fixed margins for main content to prevent edge-hugging at all viewport widths */
main {
  margin-left: 20px;
  margin-right: 20px;
}

/* Product Card Buy Button */
.product-buy-btn {
  padding: 5px 5px;
  background-color: var(--product-btn-bg) !important;
  transition: background-color 0.2s ease;
  border-radius: 0.5rem !important;
  font-family: var(--font-accent) !important;
}

.product-buy-btn:hover {
  background-color: var(--product-btn-bg-hover) !important;
}

.construction-buy-btn {
  padding: 5px 5px;
  background-color: var(--construction-btn-bg) !important;
  transition: background-color 0.2s ease;
}

.construction-buy-btn:hover {
  background-color: var(--construction-btn-bg-hover) !important;
}

.product-btn-container {
  display: flex;
  margin-top: 16px;
  margin-bottom: 8px;
}

.product-btn-container[data-align="left"] {
  justify-content: flex-start;
}

.product-btn-container[data-align="center"] {
  justify-content: center;
}

.product-btn-container[data-align="right"] {
  justify-content: flex-end;
  padding-right: 8px;
}

/* Thin border for companion product cards */
.companion-card {
  border-width: 1px !important;
}

/* Hero Section Grid Layout - Robust Mobile/Desktop Reordering */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "title"
    "book"
    "bullets";
  gap: 3rem;
  /* gap-12 equivalent */
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: min-content 1fr;
    grid-template-areas:
      "title book"
      "bullets book";
    gap: 2.5rem;
    /* gap-10 equivalent */
    align-items: start;
  }
}

.hero-area-title {
  grid-area: title;
}

.hero-area-book {
  grid-area: book;
}

.hero-area-bullets {
  grid-area: bullets;
}

/* Blog: book cards (match tools card style) */
.book-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-top: 1.5rem;
}

.book-card {
  background: #fff;
  border: 2px solid #000;
  padding: 1.25rem;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.85);
  color: #0f172a;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.book-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #000;
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
  font-family: var(--font-accent);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #111;
}

.book-card-note {
  color: #4b5563;
}

.book-body {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  align-items: flex-start;
}

.book-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border: 2px solid #000;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
}

.book-meta h4 {
  margin: 0 0 0.4rem 0;
  font-size: 1.05rem;
  line-height: 1.35;
  color: #000;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.book-author {
  margin: 0 0 0.4rem 0;
  font-family: var(--font-accent);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #4b5563;
}

.book-why {
  margin: 0 0 0.8rem 0;
  color: #111827;
}

.book-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-book {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 1.1rem;
  border: 2px solid #000;
  background: #fbbf24;
  color: #000;
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.8);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.btn-book:hover {
  background: #f59e0b;
  transform: translateY(-1px);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.8);
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.9);
}

@media (max-width: 640px) {
  .book-body {
    grid-template-columns: 1fr;
  }

  .book-image img {
    height: 220px;
  }
}
