/*
 * AI page only (ai.html). Loads after site-subpage.css and site-navbar.css; the older AI rules still live in
 * site-subpage.css, and the rules here build on or override them.
 */

/* ============================================================
   HUB: heading and copy on the left, the IMPOSSIBUILD card on the right
   ============================================================ */
body.portfolio-page.ai-page .ai-hub__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
body.portfolio-page.ai-page .ai-hub__title {
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.04;
  letter-spacing: -1.6px;
  max-width: 13ch;
  margin: 0 0 24px;
}
body.portfolio-page.ai-page .ai-hub__title .ai-hub__accent { white-space: nowrap; }
body.portfolio-page.ai-page .ai-hub__lead {
  font-family: var(--font-body);
  text-transform: none;
  font-size: 18px;
  line-height: 1.65;
  letter-spacing: 0;
  width: auto;
  max-width: 46ch;
  margin: 0;
  color: var(--neutral-600);
}

body.portfolio-page.ai-page .ai-hub__card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: clamp(28px, 3vw, 40px);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(63, 117, 245, 0.24), rgba(63, 117, 245, 0) 58%),
    var(--neutral-950);
  color: var(--white);
  box-shadow: 0 24px 60px rgba(10, 10, 10, 0.16);
}
body.portfolio-page.ai-page .ai-hub__card-watermark {
  position: absolute;
  right: -48px;
  bottom: -72px;
  z-index: -1;
  width: 260px;
  height: auto;
  fill: rgba(63, 117, 245, 0.1);
  pointer-events: none;
}
body.portfolio-page.ai-page .ai-hub__card-head {
  display: flex;
  align-items: center;
  gap: 16px;
}
body.portfolio-page.ai-page .ai-hub__card-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}
body.portfolio-page.ai-page .ai-hub__card-mark svg {
  display: block;
  width: 26px;
  height: auto;
  fill: var(--brand-blue);
}
body.portfolio-page.ai-page .ai-hub__card-title {
  font-family: var(--font-heading);
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  color: var(--white);
}
body.portfolio-page.ai-page .ai-hub__card-url {
  margin: 4px 0 0;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.62);
}
body.portfolio-page.ai-page .ai-hub__card-desc {
  max-width: 40ch;
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}
body.portfolio-page.ai-page .ai-hub__card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
body.portfolio-page.ai-page .ai-hub__card-btn { gap: 6px; }
body.portfolio-page.ai-page .ai-hub__card-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
/* The card joins the hub's scroll-in reveal (assets/copy-line-reveal.js toggles .ai-hub--revealed). */
body.portfolio-page.ai-page .ai-hub:not(.ai-hub--revealed) .ai-hub__card {
  opacity: 0;
  transform: translate3d(0, 32px, 0);
  transition: none;
}
body.portfolio-page.ai-page .ai-hub.ai-hub--revealed .ai-hub__card {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition:
    opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: 0.2s;
}
@media (prefers-reduced-motion: reduce) {
  body.portfolio-page.ai-page .ai-hub .ai-hub__card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
@media (min-width: 1025px) {
  body.portfolio-page.ai-page .ai-hub__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: clamp(48px, 6vw, 104px);
  }
}
@media (max-width: 700px) {
  body.portfolio-page.ai-page .ai-hub__inner { gap: 36px; }
  body.portfolio-page.ai-page .ai-hub__title { margin: 0 0 18px; }
  body.portfolio-page.ai-page .ai-hub__lead { font-size: 17px; }
  body.portfolio-page.ai-page .ai-hub__card-title { font-size: 20px; }
  body.portfolio-page.ai-page .ai-hub__card-desc { font-size: 16px; }
  body.portfolio-page.ai-page .ai-hub__card-watermark { width: 200px; right: -56px; bottom: -64px; }
}
@media (max-width: 420px) {
  body.portfolio-page.ai-page .ai-hub__card-actions .ai-hero__btn { flex: 1 1 100%; }
  body.portfolio-page.ai-page .ai-hub__card-head { gap: 12px; }
  body.portfolio-page.ai-page .ai-hub__card-mark { width: 44px; height: 44px; border-radius: 12px; }
  body.portfolio-page.ai-page .ai-hub__card-mark svg { width: 20px; }
  body.portfolio-page.ai-page .ai-hub__card-title { font-size: 17px; }
}

/* ============================================================
   COMMUNITIES: intro and actions on top; latest events beside the meetup photo recaps
   ============================================================ */
body.portfolio-page.ai-page .ai-communities__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px 48px;
  margin: 0 0 48px;
}
body.portfolio-page.ai-page .ai-communities__intro { max-width: 640px; }
body.portfolio-page.ai-page .ai-communities__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
body.portfolio-page.ai-page .ai-communities__cta.ai-hero__btn { margin-top: 0; }
body.portfolio-page.ai-page .ai-communities__cta--outline.ai-hero__btn {
  background: transparent;
  color: var(--neutral-950);
  border: 1px solid rgba(17, 24, 39, 0.22);
}
body.portfolio-page.ai-page .ai-communities__cta--outline.ai-hero__btn:hover {
  opacity: 1;
  background: rgba(17, 24, 39, 0.04);
  border-color: var(--neutral-950);
}

body.portfolio-page.ai-page .ai-communities__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
}
@media (min-width: 1200px) {
  body.portfolio-page.ai-page .ai-communities__body {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 2fr);
    column-gap: clamp(32px, 4vw, 56px);
    align-items: start;
  }
}

/* Latest events */
body.portfolio-page.ai-page .ai-communities__label {
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--neutral-600);
}
body.portfolio-page.ai-page .ai-communities__events {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(17, 24, 39, 0.12);
}
body.portfolio-page.ai-page .ai-communities__event {
  border-bottom: 1px solid rgba(17, 24, 39, 0.12);
}
body.portfolio-page.ai-page .ai-communities__event-link {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 18px;
  column-gap: 16px;
  align-items: baseline;
  padding: 16px 0;
  color: var(--neutral-950);
  border-radius: 4px;
}
body.portfolio-page.ai-page .ai-communities__event-when {
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--neutral-600);
  white-space: nowrap;
}
body.portfolio-page.ai-page .ai-communities__event-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
body.portfolio-page.ai-page .ai-communities__event-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}
body.portfolio-page.ai-page .ai-communities__event-city {
  font-size: 13px;
  line-height: 1.4;
  color: var(--neutral-600);
}
body.portfolio-page.ai-page .ai-communities__event-icon {
  align-self: center;
  width: 18px;
  height: 18px;
  color: var(--neutral-500);
  transition: transform 0.2s ease, color 0.2s ease;
}
body.portfolio-page.ai-page .ai-communities__event-link:hover .ai-communities__event-name {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
body.portfolio-page.ai-page .ai-communities__event-link:hover .ai-communities__event-icon {
  color: var(--brand-blue);
  transform: translate(2px, -2px);
}
body.portfolio-page.ai-page .ai-communities__event-link:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

/* Meetup photo recaps */
body.portfolio-page.ai-page .ai-communities__recaps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  align-items: start;
}
body.portfolio-page.ai-page .ai-communities__recap {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 20px;
  overflow: hidden;
  background: var(--neutral-50);
}
body.portfolio-page.ai-page .ai-communities__mosaic {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  background: rgba(17, 24, 39, 0.06);
}
body.portfolio-page.ai-page .ai-communities__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
}
body.portfolio-page.ai-page .ai-communities__photo--lead {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
}
body.portfolio-page.ai-page .ai-communities__recap-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px 20px;
}
body.portfolio-page.ai-page .ai-communities__recap-title {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--neutral-950);
}
/* The title link covers the whole card. */
body.portfolio-page.ai-page .ai-communities__recap-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
body.portfolio-page.ai-page .ai-communities__recap:hover .ai-communities__recap-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
body.portfolio-page.ai-page .ai-communities__recap-link:focus-visible { outline: none; }
body.portfolio-page.ai-page .ai-communities__recap:has(.ai-communities__recap-link:focus-visible) {
  outline: 2px solid var(--brand-blue);
  outline-offset: 3px;
}
body.portfolio-page.ai-page .ai-communities__recap-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--neutral-600);
}
body.portfolio-page.ai-page .ai-communities__recap-flag {
  display: block;
  width: auto;
  height: 12px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.12);
}
@media (max-width: 768px) {
  body.portfolio-page.ai-page .ai-communities__head { margin-bottom: 36px; }
}
/* Phones: one recap per row, with a shorter mosaic (lead photo beside the two small ones). */
@media (max-width: 640px) {
  body.portfolio-page.ai-page .ai-communities__recaps { grid-template-columns: minmax(0, 1fr); }
  body.portfolio-page.ai-page .ai-communities__mosaic { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  body.portfolio-page.ai-page .ai-communities__photo--lead {
    grid-column: 1;
    grid-row: 1 / span 2;
    aspect-ratio: auto;
    height: 100%;
    contain: size; /* fill the two rows the small photos set, without adding its own height */
  }
}
@media (max-width: 420px) {
  body.portfolio-page.ai-page .ai-communities__actions .ai-hero__btn { flex: 1 1 100%; }
  body.portfolio-page.ai-page .ai-communities__event-link {
    grid-template-columns: minmax(0, 1fr) 18px;
    row-gap: 4px;
  }
  body.portfolio-page.ai-page .ai-communities__event-when { grid-column: 1 / -1; }
}

/* ============================================================
   CTA card: primary IMPOSSIBUILD link plus a contact link
   ============================================================ */
body.portfolio-page.ai-page .cta-card > .ai-cta__actions {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
body.portfolio-page.ai-page .cta-section .ai-cta__btn-outline {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.36);
}
body.portfolio-page.ai-page .cta-section .ai-cta__btn-outline:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.64);
}
/* Keep the CTA card buttons inside the card on the narrowest phones. */
@media (max-width: 359px) {
  body.portfolio-page.ai-page .cta-section .btn { padding: 0 20px; font-size: 15px; }
}
