/* iOS App Store-style portfolio. Scoped to .screen-portfolio-appstore (grid) and .portfolio-takeover/.portfolio-toast (body-level overlays). */
.screen-portfolio-appstore { background: #000; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
.screen-portfolio-appstore .route-heading { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.screen-portfolio-appstore .screen-inner { width: min(1040px, 100%); height: auto; min-height: 0; margin: 0 auto; padding: 48px 32px 48px; box-sizing: border-box; }
.screen-portfolio-appstore #portfolio-title { margin: 0; font-family: Satoshi, system-ui, sans-serif; font-weight: 800; font-size: clamp(34px, 5vw, 56px); line-height: 1.05; letter-spacing: -.03em; color: #fff; }
.screen-portfolio-appstore .app-chips { display: flex; gap: 8px; margin: 24px 0 0; overflow-x: auto; scrollbar-width: none; }
.screen-portfolio-appstore .app-chip { flex: none; height: 36px; padding: 0 18px; border-radius: 999px; border: 0; background: transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); color: #f2f2f7; font: 500 14px/1 Satoshi, system-ui, sans-serif; cursor: pointer; transition: background .15s, color .15s; }
.screen-portfolio-appstore .app-chip:hover { background: rgba(255,255,255,.08); }
.screen-portfolio-appstore .app-chip[aria-pressed="true"] { background: #fff; color: #000; box-shadow: none; font-weight: 600; }
.screen-portfolio-appstore .app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 40px 28px; margin-top: 36px; padding-top: 12px; }
.screen-portfolio-appstore .app-card[hidden] { display: none; }
.screen-portfolio-appstore .app-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; margin: 0; padding: 18px 16px 20px; border-radius: 24px; background: none; border: 0; min-width: 0; perspective: 600px; cursor: pointer; outline: 0; transition: transform .35s cubic-bezier(.2,.8,.2,1), background .35s, box-shadow .35s; -webkit-tap-highlight-color: transparent; }
.screen-portfolio-appstore .app-card:focus-visible { box-shadow: 0 0 0 2px #4da3ff; }
.screen-portfolio-appstore .app-icon-wrap { position: relative; display: block; width: 96px; height: 96px; border-radius: 22.5%; transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; box-shadow: 0 1px 1px rgba(0,0,0,.5), 0 6px 12px rgba(0,0,0,.5), 0 18px 32px -6px rgba(0,0,0,.75), 0 0 0 .5px rgba(255,255,255,.08); }
.screen-portfolio-appstore .app-icon-wrap::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,.07) 38%, rgba(255,255,255,0) 52%, rgba(0,0,0,.16) 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 0 0 1px rgba(255,255,255,.12); }
.screen-portfolio-appstore .app-icon { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; background: #1c1c1e; }
@media (hover: hover) {
  .screen-portfolio-appstore .app-card:hover { transform: scale(1.025); background: radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.09), rgba(255,255,255,.02) 70%); box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 24px 60px -24px rgba(120,140,255,.35); }
  .screen-portfolio-appstore .app-card:hover .app-icon-wrap { transform: translateY(-6px) rotateX(8deg) rotateY(-8deg) scale(1.05); box-shadow: 0 2px 2px rgba(0,0,0,.5), 0 14px 24px rgba(0,0,0,.55), 0 30px 48px -8px rgba(0,0,0,.85), 0 0 0 .5px rgba(255,255,255,.12); }
}
.screen-portfolio-appstore .app-card:active { transform: scale(.985); }
.screen-portfolio-appstore .app-meta { display: flex; flex-direction: column; align-items: flex-start; margin-top: 18px; min-width: 0; }
.screen-portfolio-appstore .app-card h3 { margin: 0; font-family: Satoshi, system-ui, sans-serif; font-weight: 600; font-size: 17px; line-height: 1.2; color: #fff; letter-spacing: -.022em; text-transform: none; }
.screen-portfolio-appstore .app-card p { margin: 4px 0 0; font-size: 14px; line-height: 1.3; color: #98989f; max-width: 24ch; }
.screen-portfolio-appstore .app-cat { margin-top: 8px; font-size: 12px; color: #6e6e73; }
.screen-portfolio-appstore .app-status { margin-top: 12px; padding: 6px 12px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: rgba(120,120,128,.24); color: #d1d1d6; }
.screen-portfolio-appstore .app-status-live { background: rgba(10,132,255,.2); color: #4da3ff; }
@media (min-width: 900px) { .screen-portfolio-appstore .app-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 760px) {
  .screen-portfolio-appstore .screen-inner { padding: 28px 20px 32px; }
  .screen-portfolio-appstore .app-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 8px; margin-top: 24px; }
  .screen-portfolio-appstore .app-card { padding: 12px 8px 14px; }
  .screen-portfolio-appstore .app-icon-wrap { width: 84px; height: 84px; }
}

/* Full-screen product takeover (body-level, never clipped) */
.portfolio-takeover { position: fixed; inset: 0; z-index: 1000; overflow: hidden; background: #000; color: #fff; opacity: 0; visibility: hidden; transition: opacity .55s ease, visibility 0s linear .55s; font-family: Satoshi, system-ui, sans-serif; }
.portfolio-takeover.is-open { opacity: 1; visibility: visible; transition: opacity .55s ease, visibility 0s; }
.portfolio-takeover .pt-art { position: absolute; inset: -6%; background-size: cover; background-position: center; transform: scale(1.04); }
.portfolio-takeover.is-open .pt-art { animation: pt-drift 26s ease-in-out infinite alternate; }
.portfolio-takeover[data-theme="ninetails"] .pt-art { background-position: 30% 60%; }
.portfolio-takeover.has-embed .pt-art { inset: 0; background-size: cover; background-position: top center; }
.portfolio-takeover.is-open.has-embed .pt-art { animation: none; transform: none; }
.portfolio-takeover.has-scroll .pt-art { background-size: 100% auto; background-position: 50% 0%; background-repeat: no-repeat; background-color: #0b0b0d; }
.portfolio-takeover.is-open.has-scroll .pt-art { animation: pt-scroll 45s ease-in-out 1.2s infinite alternate; }
@keyframes pt-scroll { from { background-position: 50% 0%; } to { background-position: 50% 100%; } }
.portfolio-takeover .pt-frame { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.portfolio-takeover .pt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; background: transparent; }
.portfolio-takeover.has-embed .pt-scrim { background: linear-gradient(90deg, rgba(0,0,0,.82) 0%, rgba(0,0,0,.6) 28%, rgba(0,0,0,0) 58%), linear-gradient(0deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 40%); }
@media (max-width: 760px) { .portfolio-takeover.has-embed .pt-scrim { background: linear-gradient(0deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.7) 45%, rgba(0,0,0,0) 80%); } }
@keyframes pt-drift { from { transform: scale(1.04) translate3d(-1.5%, -1%, 0); } to { transform: scale(1.2) translate3d(2%, 1.5%, 0); } }
.portfolio-takeover .pt-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,.05) 35%, rgba(0,0,0,.55) 70%, rgba(0,0,0,.88) 100%), radial-gradient(90% 70% at 20% 90%, rgba(0,0,0,.55), transparent 70%); }
.portfolio-takeover .pt-back { position: absolute; top: max(20px, env(safe-area-inset-top)); left: 20px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px 0 10px; border: 0; border-radius: 999px; background: rgba(30,30,32,.55); color: #fff; font: 600 15px/1 Satoshi, system-ui, sans-serif; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); cursor: pointer; }
.portfolio-takeover .pt-back:hover { background: rgba(60,60,64,.7); }
.portfolio-takeover .pt-content { position: absolute; left: clamp(24px, 6vw, 96px); right: clamp(24px, 6vw, 96px); bottom: clamp(48px, 12vh, 120px); max-width: 640px; display: flex; flex-direction: column; align-items: flex-start; gap: 0; z-index: 1; }
.portfolio-takeover .pt-content > * { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.portfolio-takeover.is-open .pt-content > * { opacity: 1; transform: none; }
.portfolio-takeover.is-open .pt-content > :nth-child(1) { transition-delay: .15s; }
.portfolio-takeover.is-open .pt-content > :nth-child(2) { transition-delay: .25s; }
.portfolio-takeover.is-open .pt-content > :nth-child(3) { transition-delay: .35s; }
.portfolio-takeover.is-open .pt-content > :nth-child(4) { transition-delay: .45s; }
.portfolio-takeover .pt-icon { display: block; width: 120px; height: 120px; border-radius: 22.5%; position: relative; box-shadow: 0 2px 2px rgba(0,0,0,.5), 0 16px 32px rgba(0,0,0,.55), 0 34px 60px -10px rgba(0,0,0,.8), 0 0 0 .5px rgba(255,255,255,.14); }
.portfolio-takeover .pt-icon::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0) 50%); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 0 0 1px rgba(255,255,255,.12); pointer-events: none; }
.portfolio-takeover .pt-icon img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.portfolio-takeover .pt-name { margin: 28px 0 0; font-weight: 800; font-size: clamp(40px, 6vw, 72px); line-height: 1; letter-spacing: -.035em; text-shadow: 0 2px 30px rgba(0,0,0,.5); }
.portfolio-takeover .pt-blurb { margin: 14px 0 0; font-size: clamp(16px, 1.6vw, 20px); line-height: 1.45; color: rgba(255,255,255,.86); max-width: 44ch; text-shadow: 0 1px 16px rgba(0,0,0,.6); }
.portfolio-takeover .pt-actions { display: flex; align-items: center; gap: 14px; margin-top: 26px; }
.portfolio-takeover .pt-badge { padding: 6px 12px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; background: rgba(10,132,255,.28); color: #7dbcff; backdrop-filter: blur(10px); }
.portfolio-takeover .pt-visit { display: inline-flex; align-items: center; height: 46px; padding: 0 28px; border-radius: 999px; background: #fff; color: #000; font-weight: 700; font-size: 16px; text-decoration: none; transition: transform .2s, background .2s; }
.portfolio-takeover .pt-visit:hover { transform: scale(1.04); background: #f2f2f7; }
.portfolio-takeover .pt-visit[hidden] { display: none; }
.portfolio-toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); z-index: 999; transform: translate(-50%, 14px); max-width: calc(100vw - 40px); padding: 12px 20px; border-radius: 999px; background: rgba(44,44,46,.92); color: #fff; font: 500 14px/1.3 Satoshi, system-ui, sans-serif; box-shadow: 0 10px 40px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.1); backdrop-filter: blur(14px); opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s cubic-bezier(.2,.8,.2,1); }
.portfolio-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 760px) { .portfolio-takeover .pt-icon { width: 96px; height: 96px; } .portfolio-takeover .pt-content { bottom: 120px; } }
@media (prefers-reduced-motion: reduce) {
  .screen-portfolio-appstore .app-card, .screen-portfolio-appstore .app-icon-wrap { transition: none; }
  .screen-portfolio-appstore .app-card:hover, .screen-portfolio-appstore .app-card:hover .app-icon-wrap { transform: none; }
  .portfolio-takeover.is-open .pt-art, .portfolio-takeover.is-open.has-scroll .pt-art { animation: none; }
  .portfolio-takeover .pt-content > * { transform: none; transition: opacity .4s ease; }
  .portfolio-toast { transform: translate(-50%, 0); }
}

.screen-portfolio-appstore .app-sr-title { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Round 7: picture sizing, stagger entrance, still-hero drift */
.screen-portfolio-appstore .app-icon-wrap picture { display: block; width: 100%; height: 100%; }
.screen-portfolio-appstore.pg-enter .app-card { animation: pg-card-in .45s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes pg-card-in { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
.portfolio-takeover.has-still .pt-art { inset: -4%; }
.portfolio-takeover.is-open.has-still .pt-art { animation: pt-drift 26s ease-in-out infinite alternate; }
.portfolio-takeover.is-open .pt-content > :nth-child(1) { transition-delay: 0s; transition-duration: .15s; }
@media (prefers-reduced-motion: reduce) { .screen-portfolio-appstore.pg-enter .app-card { animation: none; } .portfolio-takeover.is-open.has-still .pt-art { animation: none; } }
