/* /integrations — Directory page.  GTM-3667.
   Page prefix: in-
   Asset path: ../_assets/ (one level up, same as reliability/)
   ──────────────────────────────────────────────────────────── */

/* DS baseline */
@import url("../_ds/fonts.css");
@import url("../_ds/theme.css");
@import url("../_shared/chrome.css");
@import url("../_shared/components.css");

/* ════════════════════════════════════════════════════════════
   Act 1 — Constellation hero
   Pattern F: mount-animate via CSS @keyframes (no JS needed
   for pageload animation).
   ════════════════════════════════════════════════════════════ */

[data-act="1"] {
  padding:
    clamp(140px, 19vh, 210px)
    clamp(20px, 6vw, 80px)
    clamp(80px, 12vh, 140px);
}

.in-hero-frame {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(48px, 6vw, 96px);
}

/* ── Left column: text ── */
.in-hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.in-hero-kicker {
  margin: 0 0 clamp(18px, 2.4vh, 28px);
}

.in-hero-h1 {
  margin: 0;
  font-family: var(--font-display, "Rawest", system-ui, sans-serif);
  font-size: clamp(40px, 5.2vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.026em;
  font-weight: 500;
  color: var(--text-primary);
}
.in-hero-h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--text-primary);
}

.in-hero-sub {
  margin: clamp(20px, 2.8vh, 32px) 0 0;
  font-family: var(--font-base);
  font-size: var(--mkt-body);
  line-height: 1.58;
  letter-spacing: -0.005em;
  color: var(--text-secondary);
  max-width: 48ch;
}

.in-hero-cta {
  margin-top: clamp(32px, 4.4vh, 48px);
}

/* ── Right column: constellation visual ── */
.in-hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Constellation container: SVG lines + HTML logo nodes layered */
.in-constellation {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1;
}

/* SVG background — spokes, ring, hub */
.in-c-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.in-c-ring {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
  stroke-dasharray: 3 9;
}

.in-c-spoke {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}

/* Hub: solid purple dot + dual staggered pulse rings */
.in-c-hub {
  fill: #7C4FE8;
}
.in-c-hub-pulse {
  fill: none;
  stroke: #7C4FE8;
  stroke-width: 1.5;
  animation: in-hub-pulse 2.6s ease-out infinite;
}
.in-c-hub-pulse-2 {
  fill: none;
  stroke: #7C4FE8;
  stroke-width: 1;
  animation: in-hub-pulse 2.6s ease-out infinite;
  animation-delay: 1.3s;
}
@keyframes in-hub-pulse {
  0%   { r: 12; opacity: 0.6; }
  100% { r: 42; opacity: 0;   }
}

/* ── Outer node div: positioning only ── */
.in-node {
  position: absolute;
  left: calc(var(--nx, 50) * 1%);
  top:  calc(var(--ny, 50) * 1%);
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* ── Inner node div: float animation + flex layout ── */
.in-node-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  /* Now an <a> to the tool's docs — native pointer (leaves the site),
     no link chrome so it reads as the floating logo node, not a link. */
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

/* Float animations — 3 variants for organic feel */
@keyframes in-float-a {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-9px); }
}
@keyframes in-float-b {
  0%, 100% { transform: translate(0px, 0px); }
  35%       { transform: translate(5px, -7px); }
  68%       { transform: translate(-3px, -5px); }
}
@keyframes in-float-c {
  0%, 100% { transform: translate(0px, 0px); }
  40%       { transform: translate(-4px, -8px); }
  72%       { transform: translate(3px, -4px); }
}

.in-node-inner[data-float="a"] {
  animation: in-float-a var(--dur, 4.5s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.in-node-inner[data-float="b"] {
  animation: in-float-b var(--dur, 5s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.in-node-inner[data-float="c"] {
  animation: in-float-c var(--dur, 5.5s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

/* ── Icon circle ── */
.in-node-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 260ms ease,
    border-color 260ms ease,
    box-shadow 260ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* Category glows — always visible at rest (marks the taxonomy), intensifies on hover */
.in-node-inner[data-cat="mcp"] .in-node-icon {
  border-color: rgba(122, 218, 230, 0.45);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.5),
    0 0 42px rgba(122, 218, 230, 0.22),
    0 0 12px rgba(122, 218, 230, 0.2),
    inset 0 1px 0 rgba(122, 218, 230, 0.18);
}
.in-node-inner[data-cat="framework"] .in-node-icon {
  border-color: rgba(124, 79, 232, 0.5);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.5),
    0 0 42px rgba(124, 79, 232, 0.25),
    0 0 12px rgba(124, 79, 232, 0.22),
    inset 0 1px 0 rgba(124, 79, 232, 0.18);
}
.in-node-inner[data-cat="automation"] .in-node-icon {
  border-color: rgba(110, 212, 154, 0.45);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.5),
    0 0 42px rgba(110, 212, 154, 0.2),
    0 0 12px rgba(110, 212, 154, 0.18),
    inset 0 1px 0 rgba(110, 212, 154, 0.15);
}
.in-node-inner[data-cat="dev"] .in-node-icon {
  border-color: rgba(161, 184, 255, 0.38);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.5),
    0 0 42px rgba(161, 184, 255, 0.16),
    0 0 12px rgba(161, 184, 255, 0.14),
    inset 0 1px 0 rgba(161, 184, 255, 0.12);
}

/* Hover: scale + glow brightens */
.in-node-inner:hover .in-node-icon {
  transform: scale(1.12);
}
.in-node-inner[data-cat="mcp"]:hover .in-node-icon {
  background: rgba(122, 218, 230, 0.08);
  border-color: rgba(122, 218, 230, 0.48);
  box-shadow:
    0 8px 36px rgba(0, 0, 0, 0.55),
    0 0 44px rgba(122, 218, 230, 0.22),
    inset 0 1px 0 rgba(122, 218, 230, 0.2);
}
.in-node-inner[data-cat="framework"]:hover .in-node-icon {
  background: rgba(124, 79, 232, 0.08);
  border-color: rgba(124, 79, 232, 0.5);
  box-shadow:
    0 8px 36px rgba(0, 0, 0, 0.55),
    0 0 44px rgba(124, 79, 232, 0.24),
    inset 0 1px 0 rgba(124, 79, 232, 0.18);
}
.in-node-inner[data-cat="automation"]:hover .in-node-icon {
  background: rgba(110, 212, 154, 0.07);
  border-color: rgba(110, 212, 154, 0.46);
  box-shadow:
    0 8px 36px rgba(0, 0, 0, 0.55),
    0 0 44px rgba(110, 212, 154, 0.2),
    inset 0 1px 0 rgba(110, 212, 154, 0.16);
}
.in-node-inner[data-cat="dev"]:hover .in-node-icon {
  background: rgba(161, 184, 255, 0.07);
  border-color: rgba(161, 184, 255, 0.4);
  box-shadow:
    0 8px 36px rgba(0, 0, 0, 0.55),
    0 0 44px rgba(161, 184, 255, 0.16),
    inset 0 1px 0 rgba(161, 184, 255, 0.14);
}

.in-node-icon img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

/* Dark SVG logos (black/near-black fill) — invert to white on dark bg */
.in-node-inner[data-dark] .in-node-icon img {
  filter: brightness(0) invert(0.92);
}

.in-node-label {
  font-family: var(--font-code, "IBM Plex Mono", monospace);
  font-size: 10px;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.52);
  white-space: nowrap;
  transition: color 220ms ease;
  pointer-events: none;
}
.in-node-inner:hover .in-node-label {
  color: rgba(255, 255, 255, 0.85);
}

/* ── Mount-animate (Pattern F) ── */
@keyframes in-fade-up {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0);   }
}

.in-hero-kicker {
  animation: in-fade-up 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 60ms;
}
.in-hero-h1 {
  animation: in-fade-up 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 140ms;
}
.in-hero-sub {
  animation: in-fade-up 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 260ms;
}
.in-hero-cta {
  animation: in-fade-up 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 360ms;
}
.in-hero-visual {
  animation: in-fade-up 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 180ms;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .in-hero-frame {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
    column-gap: clamp(32px, 4vw, 60px);
  }
  .in-node-icon { width: 56px; height: 56px; }
  .in-node-icon img { width: 26px; height: 26px; }
}

@media (max-width: 800px) {
  .in-hero-frame {
    grid-template-columns: 1fr;
    row-gap: clamp(48px, 8vh, 72px);
  }
  .in-hero-visual {
    order: -1;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .in-hero-visual { max-width: 320px; }
  .in-hero-h1 { font-size: var(--mkt-h3); }
  .in-node-icon { width: 48px; height: 48px; }
  .in-node-icon img { width: 22px; height: 22px; }
  .in-node-label { font-size: 8.5px; }
}

@media (min-width: 1600px) {
  .in-hero-h1 { font-size: 80px; }
  .in-hero-sub { font-size: 20px; }
}
@media (min-width: 1920px) {
  .in-hero-h1 { font-size: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  .in-hero-kicker,
  .in-hero-h1,
  .in-hero-sub,
  .in-hero-cta,
  .in-hero-visual,
  .in-c-hub-pulse,
  .in-c-hub-pulse-2 { animation: none; }
  .in-node-inner[data-float] { animation: none; }
}

/* ════════════════════════════════════════════════════════════
   Act 2 — Directory grid
   Pattern J: filter-swap via JS [hidden] toggle + CSS appear animation.
   ════════════════════════════════════════════════════════════ */

[data-act="2"] {
  padding:
    clamp(80px, 11vh, 128px)
    clamp(20px, 6vw, 80px)
    clamp(96px, 14vh, 160px);
}

.in-dir-frame {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

/* ── Filter tabs ── */
.in-dir-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: clamp(36px, 5vh, 56px);
}

.in-filter-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-base);
  font-size: 13px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
  white-space: nowrap;
}
.in-filter-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
}
.in-filter-btn.is-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

/* Category dots on filter buttons — inform taxonomy at a glance */
.in-filter-btn[data-cat]::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.in-filter-btn[data-cat="all"]::before   { display: none; }
.in-filter-btn[data-cat="mcp"]::before       { background: #7ADAE6; }
.in-filter-btn[data-cat="framework"]::before { background: #7C4FE8; }
.in-filter-btn[data-cat="automation"]::before { background: #6ED49A; }
.in-filter-btn[data-cat="dev"]::before       { background: #A1B8FF; }

/* ── Card grid ── */
.in-dir-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

/* ── Single card ── */
.in-card-wrap {
  transition: opacity 140ms ease, transform 140ms ease;
}
.in-card-wrap.is-appearing {
  animation: in-card-appear 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.in-card-wrap[hidden] {
  display: none !important;
}
@keyframes in-card-appear {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.in-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  height: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
  transition:
    background 220ms ease,
    border-color 220ms ease,
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms ease;
}
.in-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.32);
}

/* Logo container */
.in-card-logo {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 220ms ease;
}
.in-card:hover .in-card-logo {
  border-color: rgba(255, 255, 255, 0.16);
}
.in-card-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

/* Dark SVG logos — invert to white on dark surface */
.in-card-logo[data-dark] img {
  filter: brightness(0) invert(0.88);
}

/* PNG logos (opaque brand avatars) — show full-size, rounded */
.in-card-logo[data-png] {
  background: transparent;
  border: none;
  border-radius: 10px;
}
.in-card-logo[data-png] img {
  width: 40px;
  height: 40px;
  border-radius: 9px;
}

/* Card text */
.in-card-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.in-card-name {
  font-family: var(--font-base);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.in-card-tag {
  font-family: var(--font-code, "IBM Plex Mono", monospace);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-quaternary);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Category dot on card tags — mirrors filter-button taxonomy cue */
.in-card-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
}
.in-card-wrap[data-cat="mcp"] .in-card-tag::before       { background: #7ADAE6; }
.in-card-wrap[data-cat="framework"] .in-card-tag::before { background: #7C4FE8; }
.in-card-wrap[data-cat="automation"] .in-card-tag::before { background: #6ED49A; }
.in-card-wrap[data-cat="dev"] .in-card-tag::before       { background: #A1B8FF; }

/* Arrow */
.in-card-arrow {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  transition: color 200ms ease, transform 200ms ease;
}
.in-card:hover .in-card-arrow {
  color: var(--text-secondary);
  transform: translateX(3px);
}

/* ── Scroll-reveal for the grid section ── */
.in-dir-frame[data-in-dir-reveal] .in-dir-filters,
.in-dir-frame[data-in-dir-reveal] .in-dir-grid {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 640ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 640ms cubic-bezier(0.22, 1, 0.36, 1);
}
.in-dir-frame[data-in-dir-reveal].is-revealed .in-dir-filters {
  opacity: 1;
  transform: none;
  transition-delay: 0ms;
}
.in-dir-frame[data-in-dir-reveal].is-revealed .in-dir-grid {
  opacity: 1;
  transform: none;
  transition-delay: 100ms;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .in-dir-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (max-width: 600px) {
  .in-dir-grid { grid-template-columns: 1fr; gap: 8px; }
  .in-filter-btn { font-size: 12px; padding: 7px 14px; }
}
@media (min-width: 1600px) {
  .in-dir-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .in-card-wrap.is-appearing { animation: none; }
  .in-dir-frame[data-in-dir-reveal] .in-dir-filters,
  .in-dir-frame[data-in-dir-reveal] .in-dir-grid { opacity: 1; transform: none; transition: none; }
}

/* ════════════════════════════════════════════════════════════
   Act 3 — Closer (no band, on the default dark ground).
   ════════════════════════════════════════════════════════════ */

[data-act="3"] {
  padding:
    clamp(96px, 14vh, 160px)
    clamp(20px, 6vw, 80px)
    clamp(72px, 10vh, 120px);
  position: relative;
  z-index: 1;
  text-align: center;
}

.in-end-frame {
  max-width: 640px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(24px);
}
.in-end-frame.is-revealed {
  opacity: 1;
  transform: none;
  transition:
    opacity  640ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 640ms cubic-bezier(0.22, 1, 0.36, 1);
}

.in-end-kicker {
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.in-end-h2 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.5vw, 72px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0 0 20px;
}

.in-end-sub {
  font-family: var(--font-base);
  font-size: var(--mkt-body);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

.in-end-cta { margin-top: 40px; }

@media (min-width: 1600px) { .in-end-h2 { font-size: 80px; } }

@media (prefers-reduced-motion: reduce) {
  .in-end-frame { opacity: 1; transform: none; transition: none; }
}
