/* ==========================================================================
   Home page: "Portfolio Work" carousel (markup in index.html, behaviour in
   js/portfolio.js). Add a card by copying a <li class="pf-slide"> block; a dot
   is created for it automatically.
   ========================================================================== */

.pf-section {
  --pf-ink: #111418;
  --pf-muted: #4b5563;
  --pf-blue: #0a84f2;
  --pf-card-w: min(640px, calc(100vw - 150px));
  position: relative;
  padding: 52px 0 44px;
  background-color: #fff;
  background-image: radial-gradient(rgba(17, 20, 24, 0.09) 1px, transparent 1.2px);
  background-size: 18px 18px;
  font-family: "DM Sans", "Inter", sans-serif;
  overflow: hidden;
}
.pf-section::after {
  /* fade the dot grid out towards the bottom */
  content: "";
  position: absolute;
  inset: 40% 0 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 70%);
  pointer-events: none;
}
.pf-section > * { position: relative; z-index: 1; }

.pf-head { text-align: center; margin: 0 auto 18px; padding: 0 16px; }
.pf-title { margin: 0; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; font-weight: 700; color: var(--pf-ink); letter-spacing: -.01em; }

/* ---- carousel ---- */
.pf-carousel { position: relative; }
.pf-track {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 14px calc((100% - var(--pf-card-w)) / 2) 30px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pf-track::-webkit-scrollbar { display: none; }
.pf-slide {
  flex: 0 0 var(--pf-card-w);
  scroll-snap-align: center;
  display: flex;
  opacity: .45;
  transform: scale(.94);
  transition: opacity .45s ease, transform .45s ease;
}
.pf-slide.is-active { opacity: 1; transform: none; }

.pf-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  min-height: 470px;
  padding: 26px 28px 26px;
  border-radius: 22px;
  border: 1px solid #e3e7ee;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 32, 64, .06), 0 18px 40px -22px rgba(16, 32, 64, .35);
}
.pf-card--terraform { background: linear-gradient(180deg, #f6f2ec 0%, #efe9e1 100%); border-color: #e6ddd1; }

/* Terraform card */
.pf-logo { display: block; width: min(300px, 74%); height: auto; }
.pf-shot {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 32px -18px rgba(60, 40, 20, .55), 0 0 0 1px rgba(60, 40, 20, .08);
  transition: transform .4s ease, box-shadow .4s ease;
}
.pf-shot img { display: block; width: 100%; height: auto; }
.pf-slide.is-active .pf-shot:hover { transform: translateY(-3px); box-shadow: 0 22px 38px -20px rgba(60, 40, 20, .6), 0 0 0 1px rgba(60, 40, 20, .1); }
.pf-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pf-tags li { padding: 5px 12px; border-radius: 999px; background: rgba(29, 27, 25, .07); color: #3a332b; font-size: 13px; font-weight: 600; }
.pf-blurb { margin: 0; max-width: 58ch; color: #2b2723; font-size: 15.5px; line-height: 1.55; }
.pf-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  background: #1d1b19; color: #fff; font-weight: 700; font-size: 15px; text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.pf-btn[hidden] { display: none; }
.pf-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 18px -10px rgba(0, 0, 0, .55); color: #fff; }
.pf-btn svg { width: 16px; height: 16px; }
.pf-btn--blue { background: linear-gradient(180deg, #00b2fb 0%, #0083f3 100%); }

/* Under-construction cards */
.pf-sign { width: 170px; height: auto; flex: none; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .12)); }
.pf-dev { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px 26px; text-align: left; }
.pf-dev .pf-sign { width: 140px; transform: rotate(-8deg); }
.pf-card h3 { margin: 0; font-size: clamp(26px, 3.2vw, 34px); line-height: 1.12; font-weight: 700; color: var(--pf-ink); }
.pf-offer { margin: 0; max-width: 24ch; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.3; color: var(--pf-ink); }
.pf-offer strong { color: var(--pf-blue); }
.pf-contact { margin: 0; max-width: 34ch; font-size: 16.5px; font-weight: 600; line-height: 1.45; color: var(--pf-ink); }
.pf-contact a { color: var(--pf-blue); text-decoration: none; border-bottom: 1px solid rgba(10, 132, 242, .35); }
.pf-contact a:hover { border-bottom-color: currentColor; }
.pf-soon { margin: 0; font-size: clamp(30px, 3.8vw, 40px); font-weight: 700; letter-spacing: -.01em; color: var(--pf-ink); }
.pf-soon-sub { margin: -6px 0 0; color: var(--pf-muted); font-size: 17px; }
.pf-card--soon .pf-sign { width: 210px; animation: pf-bob 4s ease-in-out infinite; }
@keyframes pf-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-2deg); } }

/* Arrows */
.pf-arrow {
  position: absolute; top: calc(50% - 8px); z-index: 2;
  width: 46px; height: 46px; margin-top: -23px;
  display: grid; place-items: center;
  border: 1px solid #e3e7ee; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: #1d2733; cursor: pointer;
  box-shadow: 0 8px 20px -10px rgba(16, 32, 64, .45);
  transition: transform .2s ease, box-shadow .2s ease, color .2s ease;
}
.pf-arrow:hover { transform: scale(1.06); color: var(--pf-blue); box-shadow: 0 12px 24px -12px rgba(10, 132, 242, .55); }
.pf-arrow:focus-visible, .pf-dot:focus-visible { outline: 3px solid rgba(10, 132, 242, .5); outline-offset: 3px; }
.pf-arrow svg { width: 22px; height: 22px; }
.pf-prev { left: max(12px, calc((100% - var(--pf-card-w)) / 2 - 72px)); }
.pf-next { right: max(12px, calc((100% - var(--pf-card-w)) / 2 - 72px)); }

/* Dots */
.pf-dots { display: flex; justify-content: center; gap: 10px; margin-top: 4px; }
.pf-dot {
  width: 9px; height: 9px; padding: 0; border: 0; border-radius: 999px;
  background: #c8d0db; cursor: pointer;
  transition: width .35s ease, background .35s ease;
}
.pf-dot:hover { background: #9eabbc; }
.pf-dot[aria-current="true"] { width: 28px; background: linear-gradient(90deg, #00b2fb, #0083f3); }

/* ---- responsive ---- */
@media (max-width: 991px) {
  .pf-section { --pf-card-w: min(580px, calc(100vw - 120px)); padding: 44px 0 40px; }
  .pf-card { min-height: 450px; padding: 24px 22px; }
}
@media (max-width: 767px) {
  .pf-section { --pf-card-w: calc(100vw - 48px); padding: 36px 0 36px; }
  .pf-track { gap: 14px; padding-bottom: 22px; }
  .pf-card { min-height: 440px; padding: 22px 18px; gap: 14px; border-radius: 18px; }
  .pf-blurb { font-size: 15.5px; }
  .pf-dev { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .pf-dev .pf-sign { width: 110px; }
  .pf-card--soon .pf-sign { width: 170px; }
  .pf-contact { font-size: 16px; }
  .pf-arrow { display: none; }
  .pf-slide { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-track { scroll-behavior: auto; }
  .pf-slide, .pf-shot, .pf-dot { transition: none; }
  .pf-card--soon .pf-sign { animation: none; }
}

/* Card 2: "More projects in development" (blue wave corners) */
.pf-card--dev { position: relative; overflow: hidden; border-color: #dbe6f5; background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%); }
.pf-wave { position: absolute; pointer-events: none; }
.pf-wave--tr { top: 0; right: 0; width: 46%; height: 34%; }
.pf-wave--bl { bottom: 0; left: 0; width: 34%; height: 24%; }
.pf-dev-body { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 0 6px; }
.pf-card--dev h3 { align-self: flex-start; max-width: 13ch; text-align: left; font-size: clamp(30px, 3.8vw, 44px); line-height: 1.05; letter-spacing: -.02em; }
.pf-swoosh { align-self: flex-start; width: min(300px, 68%); height: 20px; margin: -8px 0 4px 10px; }
.pf-card--dev .pf-offer { max-width: 22ch; font-size: clamp(21px, 2.6vw, 28px); }
.pf-card--dev .pf-offer strong { color: #1a63f0; font-weight: 700; }
.pf-card--dev .pf-contact { font-weight: 500; color: #1d2733; }
.pf-btn--lg { padding: 14px 30px; font-size: 18px; box-shadow: 0 14px 24px -14px rgba(6, 69, 201, .7); background: linear-gradient(90deg, #00a8fb 0%, #0757d6 100%); }
@media (max-width: 767px) {
  .pf-card--dev h3 { align-self: center; text-align: center; }
  .pf-swoosh { align-self: center; margin-left: 0; }
  .pf-wave--tr { width: 52%; height: 22%; }
  .pf-wave--bl { width: 44%; height: 16%; }
  .pf-btn--lg { padding: 12px 24px; font-size: 16px; }
}

/* Terraform card: slightly smaller blurb to make room for the website link */
.pf-card--terraform { gap: 14px; }
.pf-card--terraform .pf-blurb { font-size: 14.5px; line-height: 1.5; }
.pf-btn--sm { padding: 9px 18px; font-size: 14.5px; }
@media (max-width: 767px) { .pf-card--terraform .pf-blurb { font-size: 14px; } }

/* Card 2: spread the text down the full card height instead of bunching it in the middle */
.pf-card--dev .pf-dev-body { flex: 1; align-self: stretch; justify-content: space-evenly; gap: 18px; padding: 18px 6px; }
.pf-card--dev .pf-swoosh { margin-top: -14px; }
.pf-dev-head { align-self: stretch; display: flex; flex-direction: column; gap: 14px; }
.pf-card--dev .pf-dev-head .pf-swoosh { margin-top: 0; }
@media (max-width: 767px) { .pf-dev-head { align-items: center; } }

/* Dots: simple circles; the current card's dot is filled blue (no stretched pill) */
.pf-dot { width: 10px; height: 10px; border-radius: 50%; transition: background .3s ease; }
.pf-dot[aria-current="true"] { width: 10px; background: #0a84f2; }

/* Card 2: everything centred, heading and underline included */
.pf-dev-head { align-items: center; }
.pf-card--dev h3 { align-self: center; text-align: center; }
.pf-card--dev .pf-swoosh { align-self: center; margin-left: 0; margin-right: 0; }
