/* Capabilities page: capabilities.php */

/* ---------- Page keyframes ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes capDrift { to { background-position: 36px 36px; } }
  @keyframes capPulse { 0% { box-shadow: 0 0 0 0 rgba(241, 43, 43, .6); } 100% { box-shadow: 0 0 0 16px rgba(241, 43, 43, 0); } }
  @keyframes capRipple { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
}

/* ---------- Hero ---------- */
.cap-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.cap-hero__lines,
.cap-hero__dots,
.cap-hero__square {
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.cap-hero__lines {
  inset: 0;
  background-image: repeating-linear-gradient(90deg, rgba(11, 11, 11, 0.06) 0 1px, transparent 1px 120px);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
}

.cap-hero__dots {
  right: -8%;
  top: 0;
  width: 60%;
  height: 100%;
  background-image: radial-gradient(rgba(11, 11, 11, 0.2) 1px, transparent 1.2px);
  background-size: 18px 18px;
  animation: capDrift 5s linear infinite;
  -webkit-mask-image: radial-gradient(closest-side, #000, transparent);
  mask-image: radial-gradient(closest-side, #000, transparent);
}

.cap-hero__square {
  right: clamp(20px, 6vw, 120px);
  top: 30%;
  width: clamp(120px, 16vw, 240px);
  height: clamp(120px, 16vw, 240px);
  border: 1px solid rgba(11, 11, 11, 0.14);
  animation: nvSpin 60s linear infinite;
}

.cap-hero__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 72px) var(--gutter) clamp(48px, 6vw, 96px);
}

.cap-hero__title {
  margin-top: clamp(28px, 4vw, 56px);
  max-width: 13ch;
  font-weight: 500;
  font-size: clamp(36px, 7.4vw, 124px);
  line-height: 0.93;
  letter-spacing: -0.05em;
  text-wrap: balance;
  animation: nvRise 1s var(--ease-out) both;
}

.cap-hero__intro {
  margin-top: clamp(24px, 3vw, 40px);
  max-width: 48ch;
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.5;
  color: var(--text);
}

.cap-hero__actions {
  margin-top: clamp(24px, 3vw, 36px);
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  align-items: center;
}

.cap-hero__btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 26px;
  background: var(--ink);
  color: var(--white);
  font-size: 15px;
  font-weight: 500;
  transition: background .2s;
}
.cap-hero__btn:hover { background: var(--red); color: var(--white); }

.cap-hero__link {
  padding: 6px 0;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 1px solid var(--ink);
}
.cap-hero__link:hover { color: var(--red); border-color: var(--red); }

/* ---------- Capability index ---------- */
.cap-index { background: var(--paper-2); }

.cap-index__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(24px, 3vw, 48px) var(--gutter) clamp(72px, 8vw, 128px);
}

/* Rows: one is highlighted at a time (.is-active, cycled by js/pages/capabilities.js) */
.cap-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1.3fr) minmax(0, 1fr) 32px;
  gap: 12px clamp(20px, 3vw, 48px);
  align-items: baseline;
  padding: clamp(28px, 3vw, 44px) 0;
  border-top: 2px solid var(--rule-strong);
  color: var(--ink);
  transition: border-color .5s, padding .3s, background .3s;
}
.cap-row:hover { color: var(--red); padding-left: 16px; background: #E2E1DA; }
.cap-row.is-active { border-top-color: var(--red); }

.cap-row__n { font-family: var(--mono); font-size: 13px; color: var(--red); }

.cap-row__head { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.cap-row__layer {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cap-row__title {
  font-size: clamp(28px, 3.4vw, 52px);
  letter-spacing: -0.045em;
  line-height: 1;
  font-weight: 500;
}

.cap-row__desc { max-width: 40ch; font-size: 16px; line-height: 1.55; color: #4A4945; }

.cap-row__arrow {
  justify-self: end;
  font-size: 24px;
  color: var(--ink);
  transition: color .5s;
}
.cap-row.is-active .cap-row__arrow { color: var(--red); }

/* ---------- Explore links ---------- */
.cap-explore { background: var(--paper); }

.cap-explore__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 6vw, 88px) var(--gutter);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(24px, 3.5vw, 56px);
}

.cap-explore__col { display: flex; flex-direction: column; }
.cap-explore__label { margin-bottom: 10px; }

.cap-explore__link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  font-size: clamp(16px, 1.3vw, 19px);
  letter-spacing: -0.015em;
  font-weight: 500;
  line-height: 1.3;
}
.cap-explore__arrow { flex: none; }

/* ---------- Explainer + FAQ ---------- */
.cap-faq { background: var(--paper); }

.cap-faq__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 8vw, 128px) var(--gutter);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: clamp(36px, 5vw, 80px);
  align-items: start;
}

.cap-faq__text { display: flex; flex-direction: column; gap: 20px; }

.cap-faq__title {
  font-size: clamp(30px, 3.8vw, 58px);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 500;
  text-wrap: balance;
}

.cap-faq__p { max-width: 58ch; font-size: 17px; line-height: 1.7; color: var(--text); }

.cap-faq__list { display: flex; flex-direction: column; }
.cap-faq__label { margin-bottom: 12px; }

.cap-faq__item,
.cap-faq__end { border-top: 1px solid var(--rule-strong); }

.cap-faq__q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  cursor: pointer;
  font-size: clamp(17px, 1.4vw, 20px);
  font-weight: 500;
  letter-spacing: -0.015em;
}

.cap-faq__icon { flex: none; font-family: var(--mono); font-size: 16px; color: var(--red); }

.cap-faq__a {
  margin-bottom: 20px;
  max-width: 60ch;
  font-size: 16px;
  line-height: 1.65;
  color: #4A4945;
}

/* ---------- Closing CTA ---------- */
.cap-cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink);
  color: var(--white);
}

.cap-cta__ring,
.cap-cta__core {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  left: 84%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.cap-cta__ring {
  border: 1px solid #1C1C1A;
  animation: capRipple 4.2s ease-in-out infinite;
}
.cap-cta__ring--1 { width: 1100px; height: 1100px; animation-delay: 1.4s; }
.cap-cta__ring--2 { width: 860px; height: 860px; animation-delay: 1.05s; }
.cap-cta__ring--3 { width: 620px; height: 620px; animation-delay: .7s; }
.cap-cta__ring--4 { width: 400px; height: 400px; animation-delay: .35s; border-color: #2A2A28; }
.cap-cta__ring--5 { width: 210px; height: 210px; animation-delay: 0s; border-color: #2A2A28; }

.cap-cta__core {
  width: 14px;
  height: 14px;
  background: var(--red);
  animation: capPulse 1.8s ease-out infinite;
}

.cap-cta__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(72px, 9vw, 144px) var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.cap-cta__title {
  max-width: 14ch;
  font-size: clamp(40px, 6vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 500;
}

.cap-cta__accent {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--red);
}

.cap-cta__text { max-width: 44ch; font-size: 18px; line-height: 1.55; color: var(--on-dark); }

.cap-cta__btn {
  align-self: flex-start;
  display: flex;
  gap: 14px;
  padding: 20px 30px;
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}
.cap-cta__btn:hover { background: var(--red); color: var(--white); }

/* ---------- Responsive (w < 640 "mobile") ---------- */
@media (max-width: 639.98px) {
  .cap-hero__square,
  .cap-cta__ring,
  .cap-cta__core { display: none; }
  .cap-row { grid-template-columns: 36px minmax(0, 1fr); }
  .cap-row__desc { grid-column: 2; }
  .cap-row__arrow { display: none; }
}
