/* =========================================================
   ULTRALINK UK — Premium SaaS Portfolio Layout
   portfolio.css — scoped under .pf-page
   ========================================================= */

.pf-page {
  --pf-primary: #1b7a8f;
  --pf-accent: #3fa67a;
  --pf-dark: #0c303e;
  --pf-ink: #142833;
  --pf-muted: #5a7380;
  --pf-line: rgba(12, 48, 62, 0.1);
  --pf-soft: #f4f7f9;
  --pf-white: #ffffff;
  --pf-radius: 22px;
  --pf-shadow: 0 18px 40px rgba(12, 48, 62, 0.1);
  color: var(--pf-ink);
  /* Avoid overflow-x: clip here — it forces overflow-y to compute to auto and
     clips the hero title / reveal transforms under the fixed header. */
  overflow: visible;
  overflow-anchor: none;
  background: #ffffff;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-family: var(--font-body); /* Inter — site body font */
}

/* Keep portfolio chrome white — override global .section:nth-of-type(even) soft tint */
.pf-page .pf-hero,
.pf-page .pf-workspace,
.pf-page .pf-workspace.section {
  background: #ffffff;
}

.pf-page *,
.pf-page *::before,
.pf-page *::after {
  box-sizing: border-box;
}

.pf-page .section {
  padding: clamp(40px, 5vw, 72px) 0;
}

.pf-page .section > .container,
.pf-page .pf-hero-inner,
.pf-page .pf-workspace-shell {
  width: 100%;
  max-width: min(1480px, 100%);
  padding-left: clamp(12px, 1.6vw, 20px);
  padding-right: clamp(12px, 1.6vw, 20px);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* ----- Reveal ----- */
.pf-page [data-reveal] {
  opacity: 0;
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.pf-page [data-reveal][data-anim='left'] {
  transform: translate3d(-36px, 10px, 0);
}

.pf-page [data-reveal][data-anim='right'] {
  transform: translate3d(36px, 10px, 0);
}

.pf-page [data-reveal][data-anim='up'] {
  transform: translate3d(0, 28px, 0);
}

.pf-page [data-reveal][data-anim='fade'] {
  transform: none;
}

.pf-page [data-reveal].revealed {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* Cards: never use slide transforms — they break rounded overflow clipping */
.pf-page .pf-shot[data-reveal],
.pf-page .pf-shot[data-reveal][data-anim='left'],
.pf-page .pf-shot[data-reveal][data-anim='right'],
.pf-page .pf-shot[data-reveal][data-anim='up'],
.pf-page .pf-shot[data-reveal][data-anim='fade'] {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .pf-page [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.pf-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 0.75rem;
  padding: 0.48rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(67, 183, 88, 0.14);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2f9a45;
  background: linear-gradient(90deg, #e8f7ec 0%, #eef3ff 100%);
}

.pf-section-lead {
  margin: 0;
  max-width: 42rem;
  color: var(--pf-muted);
  font-size: 1rem;
  line-height: 1.65;
}

/* ----- Hero ----- */
.pf-hero {
  /* Clear fixed header, then add breathing room before the kicker/title */
  padding: calc(var(--header-h, 84px) + clamp(1.75rem, 3.2vw, 2.75rem)) 0 1.25rem;
  overflow: visible;
}

.pf-hero-copy {
  text-align: center;
  max-width: 100%;
  padding-inline: 0.25rem;
  overflow: visible;
}

.pf-hero-copy h1 {
  margin: 0 auto;
  max-width: 100%;
  white-space: nowrap;
  font-family: var(--font-head); /* Plus Jakarta Sans — site heading font */
  font-weight: 700;
  /* Scales down on narrow screens so the full title stays on one line */
  font-size: clamp(1.05rem, 5.6vw, 3.3rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #0f2744;
  overflow: visible;
}

.pf-hero-lead {
  margin: 0;
  max-width: 42rem;
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  line-height: 1.7;
  color: var(--pf-muted);
}

/* ----- SaaS workspace: left tabs + right panel ----- */
.pf-workspace {
  padding-top: 0.5rem;
}

.pf-workspace-shell {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
}

.pf-sidebar {
  position: sticky;
  top: 5.5rem;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid var(--pf-line);
  box-shadow: 0 14px 34px rgba(12, 48, 62, 0.07);
  overflow: hidden;
}

.pf-sidebar-head {
  padding: 1.15rem 1.15rem 0.85rem;
  border-bottom: 1px solid var(--pf-line);
}

.pf-sidebar-label {
  margin: 0;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pf-dark);
}

.pf-sidebar-hint {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--pf-muted);
}

.pf-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.7rem;
  overflow: visible;
}

.pf-tab {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.15rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--pf-ink);
  font-family: inherit;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.pf-tab:hover,
.pf-tab:focus-visible {
  background: var(--pf-soft);
  border-color: rgba(27, 122, 143, 0.12);
  outline: none;
  color: rgb(18, 99, 251) !important;
}

.pf-tab:hover .pf-tab-name,
.pf-tab:focus-visible .pf-tab-name {
  color: rgb(18, 99, 251) !important;
}

.pf-tab.is-active {
  background: linear-gradient(90deg, #2a9af3 0%, #12c4a2 48%, #22c55e 100%);
  border-color: transparent;
  box-shadow: none;
  color: #ffffff;
}

.pf-tab.is-active:hover,
.pf-tab.is-active:focus-visible {
  background: linear-gradient(90deg, #2a9af3 0%, #12c4a2 48%, #22c55e 100%);
  border-color: transparent;
  color: #ffffff !important;
}

.pf-tab.is-active:hover .pf-tab-name,
.pf-tab.is-active:focus-visible .pf-tab-name {
  color: #ffffff !important;
}

.pf-tab-icon {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  flex-shrink: 0;
  border-radius: 10px;
  background: #eef4f6;
  color: var(--pf-primary);
  font-size: 0.92rem;
}

.pf-tab.is-active .pf-tab-icon {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.pf-tab-name {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f2744;
  line-height: 1.3;
}

.pf-tab.is-active .pf-tab-name {
  color: #ffffff;
}

.pf-main {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid var(--pf-line);
  box-shadow: 0 18px 44px rgba(12, 48, 62, 0.08);
  padding: clamp(1.35rem, 2.6vw, 2rem) clamp(1.15rem, 2.4vw, 1.75rem);
  overflow: visible;
  overflow-anchor: none;
}

.pf-panel {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.pf-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--pf-line);
}

.pf-panel-head h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-head);
  font-size: clamp(1.45rem, 2.5vw, 1.95rem);
  line-height: 1.2;
  color: #0f2744;
}

.pf-panel-stat {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  min-width: 4.6rem;
  padding: 0.7rem 0.85rem;
  border-radius: 16px;
  background: linear-gradient(160deg, #0c303e, #1b7a8f);
  color: #fff;
  text-align: center;
}

.pf-panel-stat strong {
  font-family: var(--font-head);
  font-size: 1.35rem;
  line-height: 1;
}

.pf-panel-stat span {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pf-empty {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--pf-muted);
}

/* ----- Cards ----- */
.pf-shot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.4rem);
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.pf-shot {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: 20px;
  overflow: hidden;
  isolation: isolate;
  /* Reliable clip even when ancestors/children use transforms */
  clip-path: inset(0 round 20px);
  background: #fff;
  border: 1px solid var(--pf-line);
  box-shadow: 0 12px 28px rgba(12, 48, 62, 0.07);
  transition: box-shadow 0.35s ease;
}

.pf-shot:hover,
.pf-shot:focus-within {
  box-shadow: 0 20px 40px rgba(12, 48, 62, 0.12);
}

.pf-shot-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.pf-shot-hit {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}

.pf-shot-hit--static {
  cursor: default;
}

.pf-shot-preview {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 19px 19px 0 0;
}

.pf-shot-media {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 10;
  background: color-mix(in srgb, var(--pf-accent, #1b7a8f) 55%, #0c303e);
  overflow: hidden;
  contain: paint;
}

/* Override globals.css `img { max-width:100%; height:auto }` which breaks fill images */
.pf-shot-media img,
.pf-page .pf-shot-img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center top !important;
  transform: none !important;
}

.pf-shot-meta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.95rem 1.1rem 1.1rem;
  background: #fff;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border-top: 1px solid var(--pf-line);
}

.pf-shot-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-head);
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  line-height: 1.25;
  font-weight: 700;
  color: #0f2744;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pf-shot-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 0.55rem 0.75rem;
  margin-top: 0;
}

.pf-shot-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0.7rem 1.25rem;
  border-radius: 16px;
  border: none;
  background-image: linear-gradient(90deg, #43b758 0%, #1263fb 100%);
  background-color: transparent;
  color: #ffffff !important;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700 !important;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(18, 99, 251, 0.28);
  transition:
    background-image 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}

.pf-shot-link:hover,
.pf-shot-link:focus-visible {
  background-image: linear-gradient(90deg, #3aa64e 0%, #0b4fd0 100%);
  color: #ffffff !important;
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(18, 99, 251, 0.36);
}

.pf-shot-link i {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: #ffffff;
}

/* ----- Responsive ----- */
@media (max-width: 1200px) {
  .pf-workspace-shell {
    grid-template-columns: minmax(210px, 240px) minmax(0, 1fr);
    gap: 1rem;
  }
}

/* Tablet: keep sidebar + panel layout; one card per row */
@media (max-width: 1024px) {
  .pf-page .section {
    padding: clamp(28px, 4vw, 48px) 0;
  }

  .pf-workspace-shell {
    grid-template-columns: minmax(190px, 220px) minmax(0, 1fr);
    gap: 0.9rem;
  }

  .pf-main {
    padding: clamp(1rem, 2vw, 1.35rem);
    border-radius: 18px;
  }

  .pf-shot-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .pf-page [data-reveal][data-anim='left'],
  .pf-page [data-reveal][data-anim='right'] {
    transform: translate3d(0, 40px, 0);
  }

  .pf-page .pf-shot[data-reveal],
  .pf-page .pf-shot[data-reveal][data-anim='left'],
  .pf-page .pf-shot[data-reveal][data-anim='right'] {
    transform: none;
  }
}

/* Mobile only: stack tabs above content */
@media (max-width: 720px) {
  .pf-page .section > .container,
  .pf-page .pf-hero-inner,
  .pf-page .pf-workspace-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .pf-hero {
    padding: calc(var(--header-h, 70px) + clamp(1.25rem, 3vw, 1.85rem)) 0 1rem;
  }

  .pf-workspace-shell {
    grid-template-columns: 1fr;
  }

  .pf-sidebar {
    position: static;
    border-radius: 16px;
  }

  .pf-tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.4rem;
    padding: 0.55rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .pf-tab {
    width: auto;
    min-width: max-content;
    flex: 0 0 auto;
    min-height: 2.55rem;
    padding: 0.5rem 0.7rem;
    gap: 0.55rem;
  }

  .pf-tab-icon {
    width: 2rem;
    height: 2rem;
    font-size: 0.82rem;
    border-radius: 9px;
  }

  .pf-tab-name {
    white-space: nowrap;
    font-size: 0.84rem;
  }

  .pf-panel-head {
    flex-direction: column;
    margin-bottom: 1rem;
    padding-bottom: 0.9rem;
  }

  .pf-panel-head h2 {
    font-size: clamp(1.25rem, 5vw, 1.55rem);
  }

  .pf-section-lead {
    font-size: 0.94rem;
  }

  .pf-shot {
    border-radius: 16px;
  }

  .pf-shot-media {
    aspect-ratio: 4 / 3;
  }

  .pf-shot-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem 1rem;
  }

  .pf-shot-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .pf-shot-link {
    width: 100%;
    justify-content: center;
    padding: 0.55rem 0.9rem;
  }

  .pf-shot-title {
    font-size: 1.05rem;
  }
}

@media (max-width: 480px) {
  .pf-hero-copy h1 {
    font-size: clamp(1rem, 5.2vw, 1.35rem);
  }

  .pf-main {
    padding: 0.85rem;
    border-radius: 14px;
  }

  .pf-shot-media {
    aspect-ratio: 5 / 4;
  }

  .pf-shot-link {
    font-size: 0.76rem;
    padding: 0.5rem 0.85rem;
  }
}

.pf-page .final-cta {
  margin-top: 0;
}

