/* Cog "machine" concept — layered on top of marketing/styles.css (tokens, fonts,
   nav, buttons, footer all come from there). Used both standalone (/cogs) and
   embedded as a section on the home page (.cog-section / .cog-embed). */

.cog-stage {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 1.5rem;
  max-width: 1140px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
  min-height: 72vh;
}

/* --- embedded on the home page (between the hero and "One outcome in…") --- */
.cog-section {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cog-embed {
  min-height: 56vh;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.cog-scene {
  position: relative;
}
#cogs {
  width: 100%;
  height: auto;
  overflow: visible;
  display: block;
}

/* --- gear materials --- */
.cog {
  cursor: pointer;
  outline: none;
}
.gear-body {
  fill: url(#metal);
  stroke: #17130f;
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.ring {
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 2;
}
.bolt {
  fill: #14110d;
}
.hub {
  fill: url(#hub);
  stroke: #100d0a;
  stroke-width: 1.5;
}
.hub-ring {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1.5;
}
.cog-icon {
  fill: none;
  stroke: #e8e2db;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s ease;
}
.cog-icon .fill {
  fill: #e8e2db;
  stroke: none;
}
.core-logo {
  pointer-events: none;
}
.hit {
  fill: transparent;
}

/* --- rotation (driven by the Web Animations API in cogs.js so speed can be
   ramped to slow-motion on hover; CSS only sets the pivot) --- */
.spin {
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform;
}

/* --- highlight (hover / focus / active) --- */
.cog .gear-body,
.cog .cog-icon,
.cog .hub {
  transition:
    fill 0.2s ease,
    stroke 0.2s ease;
}
.cog.active {
  filter: url(#glow);
}
.cog.active .gear-body {
  fill: url(#metalHot);
  stroke: #5a2c00;
}
.cog.active .cog-icon {
  stroke: var(--accent);
}
.cog.active .cog-icon .fill {
  fill: var(--accent);
}
.cog:focus-visible .hub-ring {
  stroke: var(--accent);
  stroke-width: 2.5;
}
/* Decorative cogs: part of the machine, but secondary + non-interactive. */
.cog.deco {
  cursor: default;
}
.cog.deco .gear-body {
  fill: #423d37;
  opacity: 0.7;
}
.cog.deco .hub {
  opacity: 0.7;
}
/* gentle "lift" on the active cog */
.cog {
  transition:
    transform 0.2s ease,
    opacity 0.3s ease,
    filter 0.3s ease;
}
.cog.active {
  transform-box: fill-box;
}

/* When a cog is focused, fade + desaturate the rest so the active one pops. */
#cogs.focused .cog:not(.active) {
  opacity: 0.32;
  filter: saturate(0.55) brightness(0.85);
}

/* --- info panel --- */
.cog-info {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: flex-start;
  max-width: 460px;
}
/* The category label — the prominent "banner" for each part. */
.eyebrow {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
/* The supporting benefit line — kept smaller than before so it doesn't dwarf
   the label above it. */
.cog-info h1,
.cog-info h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  font-weight: 600;
  color: var(--text);
  min-height: 2.3em; /* reduce layout jump as copy changes */
}
.cog-info p {
  font-size: 1.02rem;
  color: #cfc9c2;
  margin: 0;
  min-height: 4.2em;
}
.cog-info .btn {
  margin-top: 0.4rem;
}
.hint {
  font-size: 0.85rem;
  color: var(--muted);
  transition: opacity 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .spin {
    animation: none;
  }
}

@media (max-width: 880px) {
  .cog-stage {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding-top: 0.5rem;
  }
  .cog-scene {
    order: -1;
    max-width: 460px;
    margin: 0 auto;
  }
  .cog-info {
    max-width: none;
    text-align: center;
    align-items: center;
  }
  .cog-info h1 {
    min-height: 0;
  }
  .cog-info p {
    min-height: 0;
  }
}
