/* ==========================================================
   TechGuru — Portfolio section ("Interactive Mockup Theatre")
   Drop-in: link this file, paste the <section id="portfolio">,
   and include portfolio.js. All selectors are prefixed .pf-
   ========================================================== */
.pf-section {
  scroll-margin-top: calc(var(--tg-nav-h, 88px) + 18px);
  --pf-bg: #0a0c1a;
  --pf-panel: var(--color-bg-raised, #11142a);
  --pf-line: var(--tg-border, rgba(255, 255, 255, .09));
  --pf-text: var(--color-text, #eef0f8);
  --pf-dim: var(--color-text-muted, #98a0b8);
  position: relative;
  padding: var(--tg-section-y, clamp(72px, 10vw, 140px)) 0;
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(80, 100, 255, .10), transparent 70%),
    var(--pf-bg);
  color: var(--pf-text);
  font-family: inherit;
  overflow: hidden;
}
.pf-wrap { width: min(var(--tg-max, 1180px), 100% - 40px); margin-inline: auto; }

/* ---------- section header (eyebrow uses site .section-label/.tg-num) ---------- */
.pf-title { margin: 16px 0 14px; font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.08; letter-spacing: -.02em; }
.pf-lead { max-width: 640px; margin: 0 0 clamp(48px, 7vw, 88px); color: var(--pf-dim); font-size: 1.08rem; line-height: 1.6; }

/* ---------- one case study ---------- */
.pf-case { --accent: #3b82f6; margin-bottom: clamp(72px, 10vw, 128px); }
.pf-case[data-project="creative-drywall"] { --accent: #e5303a; }
.pf-case[data-project="zempel-auto"] { --accent: #4c8dff; }
.pf-case:last-of-type { margin-bottom: 0; }

.pf-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin-bottom: 28px; }
.pf-tag {
  display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: .74rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
}
.pf-name { margin: 12px 0 0; font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -.015em; line-height: 1.15; }
.pf-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; color: var(--pf-dim); font-size: .92rem; }
.pf-meta li { display: inline-flex; align-items: center; gap: 8px; }
.pf-meta li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.pf-meta .pf-live::before { background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .18); }

/* ---------- the theatre (device mockup) ---------- */
.pf-theatre { position: relative; }
.pf-theatre::before { /* accent glow under the device */
  content: ""; position: absolute; inset: 8% 6% -6%; z-index: 0; filter: blur(70px); opacity: .32;
  background: radial-gradient(closest-side, var(--accent), transparent);
}
.pf-device {
  position: relative; z-index: 1; padding: 14px 14px 18px; border-radius: 20px;
  background: linear-gradient(180deg, #2a2d3f, #171a2c);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.pf-chrome {
  display: flex; align-items: center; gap: 14px; padding: 9px 14px;
  background: #0d1020; border-radius: 10px 10px 0 0; border-bottom: 1px solid var(--pf-line);
}
.pf-dots { display: flex; gap: 6px; }
.pf-dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a3f57; }
.pf-dots i:nth-child(1) { background: #ff5f57; } .pf-dots i:nth-child(2) { background: #febc2e; } .pf-dots i:nth-child(3) { background: #28c840; }
.pf-url { flex: 1; max-width: 440px; margin-inline: auto; padding: 4px 14px; border-radius: 7px; background: rgba(255, 255, 255, .06); color: var(--pf-dim); font-size: .78rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-chrome-spacer { width: 46px; }

.pf-viewport {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #05060d;
  border-radius: 0 0 8px 8px;
}
.pf-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block;
  opacity: 0; transform: scale(1.015); transition: opacity .55s ease, transform .8s cubic-bezier(.2, .7, .2, 1); pointer-events: none; }
.pf-layer.is-active { opacity: 1; transform: none; pointer-events: auto; }
.pf-video { cursor: pointer; background: #05060d; }

/* play / pause pulse */
.pf-pulse {
  position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; z-index: 3;
  display: grid; place-items: center; border-radius: 50%; color: #fff; pointer-events: none;
  background: rgba(8, 10, 24, .6); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .25);
  opacity: 0; transform: scale(.8); transition: opacity .25s, transform .25s;
}
.pf-pulse svg { width: 30px; height: 30px; fill: currentColor; }
.pf-pulse.is-on { opacity: 1; transform: scale(1); }

/* caption + restore button */
.pf-caption {
  position: absolute; left: 16px; bottom: 16px; z-index: 3; max-width: 70%;
  padding: 8px 14px; border-radius: 999px; font-size: .84rem; font-weight: 600;
  background: rgba(8, 10, 24, .72); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .14);
  opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .35s; pointer-events: none;
}
.pf-caption.is-on { opacity: 1; transform: none; }
.pf-restore {
  position: absolute; top: 14px; right: 14px; z-index: 4; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px; font: inherit; font-size: .84rem; font-weight: 700; color: #fff; cursor: pointer;
  background: rgba(8, 10, 24, .82); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .3s, transform .3s, background .2s;
}
.pf-restore svg { width: 12px; height: 12px; fill: currentColor; }
.pf-restore.is-on { opacity: 1; transform: none; pointer-events: auto; }
.pf-restore:hover, .pf-restore:focus-visible { background: var(--accent); border-color: transparent; }

/* monitor stand */
.pf-stand { position: relative; z-index: 1; width: 160px; height: 38px; margin: -1px auto 0; background: linear-gradient(180deg, #232638, #14172a); clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%); }
.pf-foot { position: relative; z-index: 1; width: 280px; height: 8px; margin: 0 auto; border-radius: 0 0 10px 10px; background: #1a1d30; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }

/* ---------- thumbnails ---------- */
.pf-thumbs { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 30px; }
.pf-thumb {
  position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer; aspect-ratio: 16 / 9;
  background: var(--pf-panel); outline: 2px solid transparent; outline-offset: 3px;
  transition: transform .25s ease, outline-color .25s, opacity .25s; opacity: .62;
}
.pf-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform .5s ease; }
.pf-thumb:hover { opacity: 1; transform: translateY(-4px); }
.pf-thumb:hover img { transform: scale(1.05); }
.pf-thumb:focus-visible { outline-color: #fff; opacity: 1; }
.pf-thumb[aria-selected="true"] { opacity: 1; outline-color: var(--accent); }
.pf-thumb-label {
  position: absolute; inset: auto 0 0 0; padding: 18px 10px 8px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-align: left;
  color: #fff; background: linear-gradient(0deg, rgba(5, 6, 13, .88), transparent);
}
.pf-thumb--video::after { /* play badge */
  content: ""; position: absolute; left: 50%; top: 42%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 20px no-repeat;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
.pf-thumb--video img { filter: brightness(.7); }

/* ---------- details ---------- */
.pf-details { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 5vw, 72px); margin-top: clamp(40px, 6vw, 64px); }
.pf-desc { margin: 0 0 22px; color: #c4c9dc; font-size: 1.05rem; line-height: 1.7; }
.pf-features { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.pf-features li { position: relative; padding-left: 28px; color: var(--pf-text); line-height: 1.5; }
.pf-features li::before { content: ""; position: absolute; left: 0; top: .42em; width: 14px; height: 14px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 22%, transparent); border: 1px solid var(--accent); }
.pf-features li::after { content: ""; position: absolute; left: 4px; top: calc(.42em + 3px); width: 6px; height: 3px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.pf-side { padding: 26px; border-radius: 16px; background: var(--pf-panel); border: 1px solid var(--pf-line); align-self: start; }
.pf-side h4 { margin: 0 0 14px; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--pf-dim); }
.pf-stack { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.pf-stack li { padding: 7px 13px; border-radius: 8px; font-size: .86rem; font-weight: 600; background: rgba(255, 255, 255, .06); border: 1px solid var(--pf-line); }
.pf-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: #fff; text-decoration: none; padding: 11px 18px; border-radius: 10px; background: var(--accent); transition: transform .2s, filter .2s; }
.pf-link:hover { transform: translateY(-2px); filter: brightness(1.1); }
.pf-note { margin: 18px 0 0; color: var(--pf-dim); font-size: .88rem; line-height: 1.5; }
.pf-more { margin: clamp(48px, 7vw, 80px) 0 0; text-align: center; color: var(--pf-dim); }

/* ---------- scroll reveal ---------- */
.pf-reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.pf-reveal.is-in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .pf-details { grid-template-columns: 1fr; }
  .pf-thumbs { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin-inline: -20px; padding-inline: 20px; gap: 12px; scrollbar-width: none; }
  .pf-thumbs::-webkit-scrollbar { display: none; }
  .pf-thumb { flex: 0 0 38%; scroll-snap-align: start; }
}
@media (max-width: 560px) {
  .pf-device { padding: 8px 8px 10px; border-radius: 14px; }
  .pf-url, .pf-chrome-spacer { display: none; }
  .pf-chrome { padding: 7px 10px; }
  .pf-stand, .pf-foot { display: none; }
  .pf-thumb { flex-basis: 56%; }
  .pf-pulse { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
  .pf-caption { font-size: .74rem; left: 10px; bottom: 10px; }
  .pf-restore { top: 8px; right: 8px; padding: 7px 12px; font-size: .74rem; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-layer, .pf-thumb, .pf-thumb img, .pf-reveal, .pf-caption, .pf-restore { transition: none !important; }
  .pf-reveal { opacity: 1; transform: none; }
}
