/* ==========================================================================
   /portfolio — video ads for Upwork clients.
   Builds on styles.css (tokens, header, buttons, paper). The work leads:
   the first viewport is a wall of devices playing every ad on mute.
   ========================================================================== */

.pf { --bezel: #050605; --wall-h: clamp(260px, min(50vh, calc((100vw - 170px) / 3.65)), 450px); }
.pf ::selection { background: var(--lime); color: var(--ink); }
.pf .site-header .btn { flex: none; }

/* ---------- Shared ---------- */
.pf-h2 { max-width: 15ch; font-size: clamp(38px, 5vw, 76px); line-height: 1; letter-spacing: -.045em; font-weight: 500; text-wrap: balance; }
.pf-h2 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.015em; color: #d9dccd; }
.paper .pf-h2 em { color: var(--ink); }

/* A device is a bezel around a video. Phones are 9:16, the screen is 16:9. */
.pf-device { position: relative; display: block; overflow: hidden; background: var(--bezel); border: 1px solid rgba(237, 234, 224, .14); box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .8), inset 0 0 0 5px var(--bezel); }
.pf-device video { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--bezel); }
.pf-phone { aspect-ratio: 9 / 16; border-radius: clamp(18px, 2.2vw, 30px); padding: 5px; }
.pf-phone video { border-radius: clamp(13px, 1.7vw, 24px); }
.pf-screen { aspect-ratio: 16 / 9; border-radius: 14px; padding: 5px; }
.pf-screen video { border-radius: 9px; }

/* ---------- Hero ---------- */
.pf-hero { position: relative; padding: calc(var(--header-h) + clamp(28px, 5vh, 56px)) 0 clamp(64px, 8vw, 110px); }
.pf-hero-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); align-items: end; gap: clamp(28px, 5vw, 80px); }
.pf-title { font-size: clamp(36px, 4.6vw, 70px); line-height: 1; letter-spacing: -.045em; font-weight: 500; text-wrap: balance; animation: fade-up 1s var(--ease) .05s both; }
.pf-title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.015em; color: var(--lime); }
.pf-lead { max-width: 46ch; color: var(--muted); font-size: clamp(16px, 1.2vw, 18px); line-height: 1.6; text-wrap: pretty; }
.pf-hero-side { animation: fade-up 1s var(--ease) .18s both; }
.pf-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 26px; }

.pf-wall { display: flex; align-items: flex-end; justify-content: safe center; gap: clamp(12px, 1.6vw, 24px); width: min(calc(100% - var(--gutter) * 2), 1440px); margin: clamp(36px, 5vh, 60px) auto 0; }
.pf-unit { display: grid; gap: 12px; flex: none; color: inherit; text-decoration: none; animation: wall-in 1.1s var(--ease) both; }
.pf-unit:nth-child(1) { animation-delay: .25s; }
.pf-unit:nth-child(2) { animation-delay: .32s; }
.pf-unit:nth-child(3) { animation-delay: .39s; }
.pf-unit:nth-child(4) { animation-delay: .46s; }
.pf-unit:nth-child(5) { animation-delay: .53s; }
@keyframes wall-in { from { opacity: 0; transform: translateY(28px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.pf-unit .pf-phone { height: var(--wall-h); }
.pf-unit .pf-screen { height: calc(var(--wall-h) * .75); }
.pf-unit .pf-device { transition: transform .6s var(--ease), border-color .3s ease, box-shadow .6s var(--ease); }
.pf-unit:hover .pf-device, .pf-unit:focus-visible .pf-device { transform: translateY(-6px); border-color: var(--lime); box-shadow: 0 40px 70px -26px rgba(0, 0, 0, .9), 0 0 0 1px rgba(214, 242, 107, .25), inset 0 0 0 5px var(--bezel); }
.pf-unit:focus-visible { outline: none; }

/* Play cue: a lime ring with a triangle, shown on hover/focus. */
.pf-unit .pf-device::after { content: ""; position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: var(--lime) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.5v13l11-6.5z' fill='%2311150a'/%3E%3C/svg%3E") 55% 50% / 24px no-repeat; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); opacity: 0; transform: scale(.7); transition: opacity .3s ease, transform .5s var(--ease); }
.pf-unit:hover .pf-device::after, .pf-unit:focus-visible .pf-device::after { opacity: 1; transform: none; }

.pf-unit-meta { display: flex; flex-direction: column; gap: 3px; padding-left: 4px; }
.pf-unit-meta b { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.pf-unit-meta span { color: var(--faint); font: 500 12px/1.3 var(--font-mono); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.pf-unit:hover .pf-unit-meta b { color: var(--lime); }
/* Tally light: lime while that monitor is live. */
.pf-unit-meta b::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 8px 1px 0; border-radius: 50%; background: var(--faint); vertical-align: middle; transition: background .3s ease, box-shadow .3s ease; }
.pf-unit.is-live .pf-unit-meta b::before { background: var(--lime); box-shadow: 0 1px 6px rgba(214, 242, 107, .55); }
.pf-wall-note { margin-top: 26px; color: var(--faint); font-size: 14px; line-height: 1.55; text-align: center; text-wrap: balance; }

/* ---------- Work ---------- */
.pf-work { padding: clamp(80px, 10vw, 150px) 0 clamp(40px, 6vw, 80px); border-top: 1px solid var(--line); }
.pf-work .pf-h2 { margin-bottom: clamp(48px, 6vw, 90px); }
.pf-case { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: clamp(32px, 6vw, 110px); padding: clamp(48px, 6vw, 88px) 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 8px); }
.pf-stage { display: grid; justify-items: center; gap: 16px; }
.pf-stage .pf-phone { width: min(100%, 340px); }
.pf-stage .pf-screen { width: 100%; }
.pf-case.is-target .pf-player { border-color: var(--lime); }
.pf-player video { cursor: pointer; }
/* Poster first: a lime play button instead of the browser's control bar. */
.pf-play { position: absolute; left: 18px; bottom: 18px; width: 56px; height: 56px; border: 0; border-radius: 50%; background: var(--lime) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.5v13l11-6.5z' fill='%2311150a'/%3E%3C/svg%3E") 56% 50% / 24px no-repeat; box-shadow: 0 14px 34px rgba(0, 0, 0, .5); cursor: pointer; transition: transform .45s var(--ease), background-color .25s ease; }
.pf-play:hover { transform: scale(1.06); background-color: #e7fb96; }
.pf-play:focus-visible { outline-offset: 6px; }
.pf-player.is-started .pf-play { display: none; }
.pf-player.pf-phone, .pf-player.pf-screen { transition: border-color .4s ease; }

/* Rift Rovers flips between phone and screen; the stage keeps the column. */
.pf-case[data-shape="screen"] { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }

.pf-case-wide { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }

.pf-variants { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; }
.pf-variants button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 500 13px/1 var(--font-sans); cursor: pointer; transition: background .25s ease, color .25s ease; }
.pf-variants button:hover { color: var(--text); }
.pf-variants button[aria-pressed="true"] { background: var(--text); color: var(--ink); }

.pf-case-copy { max-width: 62ch; }
.pf-tag { margin-top: 14px; text-wrap: balance; color: var(--faint); font: 500 13px/1.5 var(--font-mono); letter-spacing: .01em; }
.pf-tag span { color: var(--text); font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; }
.pf-tag span.is-own { color: var(--lime); }
.pf-case h3 { font-size: clamp(26px, 2.6vw, 40px); line-height: 1.08; letter-spacing: -.035em; font-weight: 500; text-wrap: balance; }
.pf-case-copy > p:not(.pf-tag) { margin-top: 18px; color: var(--muted); font-size: 17px; line-height: 1.65; text-wrap: pretty; }
.pf-specs { display: grid; gap: 14px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.pf-specs div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; }
.pf-specs dt { padding-top: 2px; color: var(--faint); font: 500 13px/1.4 var(--font-sans); }
.pf-specs dd { margin: 0; color: var(--text); font-size: 15.5px; line-height: 1.55; }

/* ---------- Approach (paper) ---------- */
.pf-approach { padding: clamp(90px, 11vw, 160px) 0; background: var(--paper); color: var(--ink); }
.pf-beliefs { display: grid; gap: 0; margin-top: clamp(44px, 5vw, 76px); border-top: 1px solid var(--ink-line); }
.pf-beliefs li { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) 12rem; align-items: baseline; gap: 18px clamp(24px, 4vw, 64px); padding: clamp(28px, 3vw, 44px) 0; border-bottom: 1px solid var(--ink-line); }
.pf-beliefs h3 { font-size: clamp(24px, 2.5vw, 38px); line-height: 1.08; letter-spacing: -.035em; font-weight: 500; text-wrap: balance; }
.pf-beliefs p { color: var(--ink-muted); font-size: 17px; line-height: 1.62; text-wrap: pretty; }
.pf-see { justify-self: end; color: var(--ink); font-size: 14.5px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--lime-deep); text-decoration-thickness: 2px; text-underline-offset: 5px; white-space: nowrap; }
.pf-see:hover { color: var(--lime-deep); }

/* ---------- About ---------- */
.pf-about { padding: clamp(90px, 11vw, 160px) 0; }
.pf-about-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: center; gap: clamp(36px, 6vw, 110px); }
.pf-portrait { overflow: hidden; border: 1px solid var(--line-2); border-radius: 22px; background: var(--surface); aspect-ratio: 4 / 5; }
.pf-portrait img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.9) contrast(1.02); }
.pf-about-copy { max-width: 64ch; }
.pf-about-copy p { margin-top: 22px; color: var(--muted); font-size: 17px; line-height: 1.68; text-wrap: pretty; }
.pf-about-copy .pf-h2 + p { margin-top: 32px; }
.pf-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.pf-facts li { color: var(--text); font-size: 15px; line-height: 1.5; }
.pf-facts span { display: block; margin-bottom: 6px; color: var(--faint); font: 500 13px/1.4 var(--font-sans); }

/* ---------- Packages ---------- */
.pf-packages { padding: clamp(90px, 11vw, 160px) 0; border-top: 1px solid var(--line); }
.pf-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); margin-top: clamp(40px, 5vw, 64px); }
.pf-steps li { display: grid; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.pf-steps b { color: var(--lime); font: 500 13px/1 var(--font-mono); font-variant-numeric: tabular-nums; }

.pf-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(48px, 6vw, 80px); border: 1px solid var(--line-2); border-radius: 22px; overflow: hidden; }
.pf-tier { display: grid; align-content: start; gap: 6px; padding: clamp(26px, 3vw, 40px); }
.pf-tier + .pf-tier { border-left: 1px solid var(--line-2); }
.pf-tier.is-mid { background: rgba(214, 242, 107, .045); }
.pf-tier h3 { color: var(--muted); font-size: 15px; font-weight: 500; }
.pf-price { font-size: clamp(56px, 6vw, 88px); font-weight: 500; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.pf-tier.is-mid .pf-price { color: var(--lime); }
.pf-tier-line { margin-top: 10px; color: var(--text); font-size: 16.5px; line-height: 1.45; }
.pf-tier ul { display: grid; gap: 9px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.pf-tier li { position: relative; padding-left: 18px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.pf-tier li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 1.5px; background: var(--lime); }
.pf-tiers-note { max-width: 78ch; margin-top: 24px; color: var(--faint); font-size: 14.5px; line-height: 1.6; }
.pf-tiers-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 36px; }
.pf-tiers-actions p { max-width: 44ch; color: var(--muted); font-size: 15px; line-height: 1.5; }

/* ---------- Close ---------- */
.pf-close { padding: clamp(100px, 12vw, 180px) 0; border-top: 1px solid var(--line); background: radial-gradient(ellipse 60% 70% at 50% 100%, rgba(214, 242, 107, .07), transparent 70%); }
.pf-close-title { max-width: 18ch; font-size: clamp(40px, 5.6vw, 88px); line-height: 1; letter-spacing: -.04em; font-weight: 500; text-wrap: balance; }
.pf-close-title em { display: block; font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.015em; color: var(--lime); }
.pf-close-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

.pf-footer { padding: 28px 0 40px; border-top: 1px solid var(--line); }
.pf-footer .shell { display: flex; justify-content: space-between; gap: 16px; color: var(--faint); font-size: 13.5px; }
.pf-footer a { color: var(--muted); text-underline-offset: 4px; }
.pf-footer a:hover { color: var(--lime); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .pf-wall { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); width: 100%; padding: 8px var(--gutter) 14px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
  .pf-unit { scroll-snap-align: start; }
}

@media (max-width: 980px) {
  .pf-hero-head { grid-template-columns: 1fr; align-items: start; }
  .pf-case, .pf-case-wide, .pf-case[data-shape="screen"] { grid-template-columns: 1fr; }
  .pf-stage .pf-phone { width: min(100%, 320px); }
  .pf-beliefs li { grid-template-columns: 1fr; }
  .pf-see { justify-self: start; }
  .pf-about-grid { grid-template-columns: 1fr; }
  .pf-portrait { max-width: 360px; }
  .pf-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-tiers { grid-template-columns: 1fr; }
  .pf-tier + .pf-tier { border-left: 0; border-top: 1px solid var(--line-2); }
}

@media (max-width: 720px) {
  .pf { --wall-h: min(68vw, 320px); }
  .pf .site-header .btn-sm { padding: 0 14px; }
  .pf-unit .pf-screen { height: calc(var(--wall-h) * .62); }
  .pf-facts { grid-template-columns: 1fr; }
  .pf-steps { grid-template-columns: 1fr; }
  .pf-specs div { grid-template-columns: 1fr; gap: 4px; }
  .pf-case-copy > p:not(.pf-tag) { font-size: 16px; }
  .pf-footer .shell { flex-direction: column; }
}

@media (max-width: 400px) {
  .pf .site-header .btn-sm span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pf-unit, .pf-title, .pf-hero-side { animation: none; }
  .pf-unit .pf-device { transition: none; }
}
