/* Custom projects page (assets/js/custom.js). */
.cp { --cp-ink: #0b1d33; --cp-text: #3d4f66; --cp-muted: #66768a; --cp-line: #e3e9f0; --cp-blue: #1f4e8c; --cp-sky: #31a1f7; font-family: var(--mag-sans); color: var(--cp-ink); background: #fff; }
.cp-hero { position: relative; overflow: hidden; padding: 168px 24px 128px; text-align: center; }
.cp-hero-inner { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; }
.cp-eyebrow { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 0 26px; font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace; font-size: 12.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--cp-blue); }
.cp-eyebrow::before, .cp-eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; opacity: 0.6; }
.cp-hero h1 { margin: 0; font-family: var(--mag-serif); font-size: clamp(44px, 7vw, 92px); font-weight: 700; line-height: 1.02; letter-spacing: -0.03em; text-wrap: balance; }

/* "We build ___": one word at a time, sliding up, the pill resizing to fit. */
.cp-rotate { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; margin: 34px 0 0; font-size: clamp(20px, 2.4vw, 28px); color: var(--cp-text); }
.cp-word-wrap {
  position: relative; display: inline-block; height: 1.7em; overflow: hidden; vertical-align: middle;
  padding: 0 18px; border-radius: 999px; background: #eef6fe; box-shadow: inset 0 0 0 1px #d6e9fb; color: var(--cp-blue);
  transition: width 650ms cubic-bezier(0.22, 1, 0.36, 1);
}
.cp-words { display: block; transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1); }
.cp-words > span { display: block; height: 1.7em; line-height: 1.7em; font-weight: 600; white-space: nowrap; transition: opacity 400ms ease; }
.cp-words > span:not(.is-current) { opacity: 0.15; }
.cp-hero > .cp-hero-inner > p.cp-sub { max-width: 56ch; margin: 30px auto 0; font-size: 18px; line-height: 1.65; color: var(--cp-text); }
.cp-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 22px; margin-top: 38px; }
.cp-link { font-size: 14px; font-weight: 600; color: var(--cp-text); text-decoration: underline; text-decoration-color: #b8c4d2; text-underline-offset: 4px; transition: color 150ms ease, text-decoration-color 150ms ease; }
.cp-link:hover { color: var(--cp-ink); text-decoration-color: var(--cp-ink); }

/* What we build: eight tiles; a soft light follows the pointer across them. */
.cp-build { padding: 40px 24px 120px; }
.cp-head { max-width: 680px; margin: 0 auto 48px; text-align: center; }
.cp-head h2 { margin: 0 0 14px; font-family: var(--mag-serif); font-size: clamp(32px, 4vw, 48px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.cp-head p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--cp-text); }
.cp-grid { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; max-width: 1120px; margin: 0 auto; padding: 1px; border-radius: 20px; background: var(--cp-line); overflow: hidden; }
.cp-grid::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 300ms ease;
  background: radial-gradient(420px circle at var(--cp-x, 50%) var(--cp-y, 50%), rgba(49, 161, 247, 0.55), transparent 60%);
}
.cp-grid:hover::before { opacity: 1; }
.cp-tile {
  position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; min-height: 196px; padding: 28px 26px;
  background: #fff; transition: background-color 250ms ease;
}
.cp-tile::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 300ms ease;
  background: radial-gradient(320px circle at var(--cp-tx, 50%) var(--cp-ty, 50%), rgba(49, 161, 247, 0.07), transparent 70%);
}
.cp-grid:hover .cp-tile::after { opacity: 1; }
.cp-tile:first-child { border-top-left-radius: 19px; }
.cp-tile:nth-child(4) { border-top-right-radius: 19px; }
.cp-tile:nth-child(5) { border-bottom-left-radius: 19px; }
.cp-tile:last-child { border-bottom-right-radius: 19px; }
.cp-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 10px; border-radius: 12px; background: #f2f6fa; color: var(--cp-blue); transition: transform 400ms cubic-bezier(0.34, 1.4, 0.64, 1), background-color 250ms ease; }
.cp-icon svg { width: 19px; height: 19px; }
@media (hover: hover) and (pointer: fine) {
  .cp-tile:hover .cp-icon { transform: translateY(-2px) rotate(-6deg); background: #e6f2fd; }
}
.cp-tile h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--cp-ink); }
.cp-tile p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--cp-muted); }

/* Closing call. */
.cp-close { padding: 0 24px 120px; }
.cp-card { position: relative; overflow: hidden; max-width: 1120px; margin: 0 auto; padding: 76px 32px; border-radius: 24px; background: #0b1d33; color: #fff; text-align: center; }
.cp-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px), linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 116px 30px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, #000, transparent);
          mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, #000, transparent);
}
.cp-card::after { content: ""; position: absolute; left: 50%; top: -260px; width: 760px; height: 520px; margin-left: -380px; pointer-events: none; background: radial-gradient(closest-side, rgba(49, 161, 247, 0.28), transparent); }
.cp-card > * { position: relative; z-index: 1; }
.cp-card h2 { margin: 0 0 14px; font-family: var(--mag-serif); font-size: clamp(30px, 4vw, 46px); font-weight: 700; letter-spacing: -0.02em; }
.cp-card p { max-width: 54ch; margin: 0 auto 34px; font-size: 17px; line-height: 1.6; color: rgba(255, 255, 255, 0.72); }
.cp-card-btn { display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 12px 0 24px; border-radius: 999px; background: #fff; color: #0b1d33; font-size: 15px; font-weight: 700; transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 200ms ease; }
.cp-card-btn span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #0b1d33; color: #fff; font-size: 12px; transition: transform 300ms cubic-bezier(0.34, 1.5, 0.64, 1); }
@media (hover: hover) and (pointer: fine) {
  .cp-card-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.6); }
  .cp-card-btn:hover span { transform: rotate(45deg); }
}
.cp-card-btn:active { transform: scale(0.98); }
.cp-card-btn:focus-visible { outline: 2px solid #31a1f7; outline-offset: 3px; }

/* Things rise in as they come into view, one after another. */
.cp-reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms ease, transform 800ms cubic-bezier(0.22, 1, 0.36, 1); transition-delay: var(--cp-delay, 0ms); }
.cp-reveal.is-in { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .cp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-tile:nth-child(n) { border-radius: 0; }
  .cp-tile:first-child { border-top-left-radius: 19px; }
  .cp-tile:nth-child(2) { border-top-right-radius: 19px; }
  .cp-tile:nth-child(7) { border-bottom-left-radius: 19px; }
  .cp-tile:last-child { border-bottom-right-radius: 19px; }
}
@media (max-width: 560px) {
  .cp-hero { padding: 128px 20px 88px; }
  .cp-grid { grid-template-columns: minmax(0, 1fr); }
  .cp-tile:nth-child(n) { border-radius: 0; min-height: 0; }
  .cp-tile:first-child { border-radius: 19px 19px 0 0; }
  .cp-tile:last-child { border-radius: 0 0 19px 19px; }
  .cp-card { padding: 56px 22px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .cp-reveal { opacity: 1; transform: none; transition: none; }
  .cp-word-wrap, .cp-words, .cp-words > span, .cp-icon { transition: none; }
}
