/* ==========================================================================
   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; }

/* Desktop: bigger cards (640 -> 820px wide, taller, larger logo and text) */
@media (min-width: 992px) {
  .pf-section { --pf-card-w: min(820px, calc(100vw - 200px)); }
  .pf-card { min-height: 580px; padding: 34px 40px; gap: 20px; border-radius: 26px; }
  .pf-logo { width: min(360px, 74%); }
  .pf-blurb { font-size: 17px; }
  .pf-tags li { font-size: 14px; padding: 6px 14px; }
  .pf-card--soon .pf-sign { width: 250px; }
  .pf-dev .pf-sign { width: 170px; }
}
/* tablet: bigger heading, section sits closer to the services form above */
@media (min-width: 768px) and (max-width: 991px) {
  .pf-section { padding-top: 28px; }
  .pf-title { font-size: 42px; }
}
@media (max-width: 767px) { .pf-section { padding-top: 36px; } }

/* PhaseKey card: same layout as Terraform, in PhaseKey blue */
.pf-card--phasekey { background: linear-gradient(180deg, #f2f8ff 0%, #e6f1fd 100%); border-color: #d3e4f6; }
.pf-card--phasekey .pf-shot { box-shadow: 0 16px 32px -18px rgba(16, 60, 130, .5), 0 0 0 1px rgba(16, 60, 130, .08); }
.pf-card--phasekey .pf-tags li { background: rgba(10, 122, 232, .1); color: #0b3f91; }
.pf-card--phasekey .pf-blurb { color: #1f2a3a; }
button.pf-btn { border: 0; cursor: pointer; font-family: inherit; }
.pf-card--phasekey .pf-btn { background: linear-gradient(180deg, #00b2fb 0%, #0083f3 100%); }

/* "See ad concepts" pop-up */
.pf-ads { width: min(1080px, calc(100vw - 24px)); height: min(900px, calc(100vh - 40px)); height: min(900px, calc(100dvh - 40px)); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 22px; background: #fff; color: #111418; box-shadow: 0 30px 80px -20px rgba(0, 20, 60, .55); overflow: hidden; }
.pf-ads::backdrop { background: rgba(8, 14, 28, .62); backdrop-filter: blur(3px); }
.pf-ads[open] { display: flex; flex-direction: column; animation: pf-ads-in .25s ease; }
@keyframes pf-ads-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.pf-ads-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid #e6ecf3; }
.pf-ads-head h3 { margin: 0; font-family: "DM Sans", "Inter", sans-serif; font-size: 22px; font-weight: 700; }
.pf-ads-x { flex: none; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #eef3f9; color: #111418; cursor: pointer; }
.pf-ads-x svg { width: 18px; height: 18px; }
.pf-ads-x:focus-visible, .pf-ads-thumb:focus-visible, .pf-ads-nav:focus-visible { outline: 3px solid rgba(0, 131, 243, .45); outline-offset: 2px; }
.pf-ads-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 18px 22px 16px; }
.pf-ads-thumbs { flex: none; display: grid; grid-template-columns: repeat(var(--pf-ads-n, 7), 72px); justify-content: center; gap: 10px; margin: 0; padding: 4px; list-style: none; }
.pf-ads-thumb { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #eef3f9; cursor: pointer; opacity: .55; box-shadow: 0 0 0 1px rgba(16, 32, 64, .1); transition: opacity .2s, box-shadow .2s, transform .2s; }
.pf-ads-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pf-ads-thumb:hover { opacity: .85; }
.pf-ads-thumb.is-active { opacity: 1; box-shadow: 0 0 0 3px #0083f3, 0 8px 18px -8px rgba(0, 131, 243, .7); transform: translateY(-2px); }
.pf-ads-stage { flex: 1; min-height: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto; align-items: center; column-gap: 14px; row-gap: 12px; }
.pf-ads-prev { grid-area: 1 / 1; }
.pf-ads-next { grid-area: 1 / 3; }
.pf-ads-view { grid-area: 1 / 2; min-width: 0; height: 100%; margin: 0; display: flex; align-items: center; justify-content: center; border-radius: 16px; background: #f3f6fa; padding: 12px; box-sizing: border-box; }
.pf-ads-big { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 10px; box-shadow: 0 14px 30px -18px rgba(16, 32, 64, .55); }
.pf-ads-nav { flex: none; width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #0083f3; color: #fff; cursor: pointer; box-shadow: 0 10px 22px -10px rgba(0, 131, 243, .8); transition: background .2s, transform .2s; }
.pf-ads-nav:hover { background: #006fd0; transform: scale(1.05); }
.pf-ads-nav svg { width: 22px; height: 22px; }
.pf-ads-count { grid-area: 2 / 2; margin: 0; text-align: center; color: #4b5563; font-size: 14px; font-weight: 600; letter-spacing: .04em; }
.pf-ads-empty { margin: 30px 0; text-align: center; color: #4b5563; font-size: 16px; }
@media (max-width: 991px) {
  .pf-ads { height: min(780px, calc(100dvh - 40px)); }
  .pf-ads-thumbs { grid-template-columns: repeat(var(--pf-ads-n, 7), 64px); gap: 8px; }
  .pf-ads-thumb { border-radius: 10px; }
}
@media (max-width: 767px) {
  .pf-ads { border-radius: 18px; height: min(600px, calc(100dvh - 24px)); width: calc(100vw - 20px); }
  .pf-ads-head { padding: 12px 16px; }
  .pf-ads-head h3 { font-size: 19px; }
  .pf-ads-body { padding: 12px 14px 12px; gap: 12px; }
  .pf-ads-thumbs { grid-template-columns: repeat(var(--pf-ads-n, 7), minmax(0, 44px)); gap: 6px; }
  .pf-ads-thumb { border-radius: 8px; }
  .pf-ads-stage { column-gap: 0; row-gap: 10px; }
  .pf-ads-view { grid-area: 1 / 1 / 2 / 4; }
  .pf-ads-view { padding: 8px; }
  .pf-ads-nav { width: 42px; height: 42px; }
  .pf-ads-prev { grid-area: 2 / 1; justify-self: start; }
  .pf-ads-next { grid-area: 2 / 3; justify-self: end; }
  .pf-ads-nav svg { width: 19px; height: 19px; }
}
@media (prefers-reduced-motion: reduce) { .pf-ads[open] { animation: none; } .pf-ads-thumb, .pf-ads-nav { transition: none; } }
/* PhaseKey card: smaller logo so the full website screenshot fits */
.pf-card--phasekey .pf-logo { width: min(230px, 58%); }
@media (min-width: 992px) { .pf-card--phasekey .pf-logo { width: min(260px, 60%); } }
@media (max-width: 767px) { .pf-card--phasekey .pf-logo { width: min(200px, 56%); } }
/* "Portfolio Showcase" heading: a touch bigger at every size */
.pf-title { font-size: clamp(33px, 4.4vw, 48px); }
@media (min-width: 768px) and (max-width: 991px) { .pf-title { font-size: 46px; } }

/* Terraform card: website link + brown "See ad concepts" button side by side */
.pf-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pf-btn--brown { background: linear-gradient(180deg, #9a6a3a 0%, #6b4220 100%); }
.pf-btn--brown:hover { box-shadow: 0 10px 18px -10px rgba(107, 66, 32, .75); }
/* Terraform ad gallery: brown accents instead of PhaseKey blue */
.pf-ads--terraform .pf-ads-head { border-bottom-color: #ece3d8; }
.pf-ads--terraform .pf-ads-x, .pf-ads--terraform .pf-ads-thumb { background: #f4eee6; }
.pf-ads--terraform .pf-ads-view { background: #f7f2ec; }
.pf-ads--terraform .pf-ads-thumb.is-active { box-shadow: 0 0 0 3px #7d4f27, 0 8px 18px -8px rgba(107, 66, 32, .7); }
.pf-ads--terraform .pf-ads-nav { background: #7d4f27; box-shadow: 0 10px 22px -10px rgba(107, 66, 32, .8); }
.pf-ads--terraform .pf-ads-nav:hover { background: #643e1d; }
.pf-ads--terraform .pf-ads-x:focus-visible, .pf-ads--terraform .pf-ads-thumb:focus-visible, .pf-ads--terraform .pf-ads-nav:focus-visible { outline-color: rgba(125, 79, 39, .45); }
