/* Portfolio page. Everything here builds on the main site's tokens in /styles.css. */

.pf { position: relative; padding-top: calc(var(--head-h) + clamp(40px, 7vw, 96px)); overflow: clip; }
.pf::after { content: ''; position: absolute; z-index: 0; top: -20vw; right: -14vw; width: 60vw; height: 60vw; border-radius: 50%; background: radial-gradient(circle, rgb(255 138 61 / .13), transparent 66%); pointer-events: none; }
.pf-head { position: relative; z-index: 1; }
.pf-title { margin: 14px 0 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(2.7rem, 1.2rem + 7.2vw, 7.5rem); line-height: .98; letter-spacing: -.02em; }
.pf-title span { display: block; color: var(--sodium); }
.pf-lede { max-width: 38em; margin: 26px 0 0; font-size: var(--step-1); line-height: 1.4; }
.pf-note { max-width: 44em; margin: 16px 0 0; font-size: .875rem; color: var(--mist); }

/* ---- The grid: a composition, not a row of tiles ---- */
.pf-grid { position: relative; z-index: 1; display: grid; gap: clamp(36px, 5vw, 64px) 28px; margin-block: clamp(50px, 7vw, 100px) 0; padding-block: 0; list-style: none; }
.pf-card { display: block; color: inherit; text-decoration: none; }
.pf-card__shot { display: block; overflow: hidden; border: 1px solid var(--rule); border-radius: 12px; background: var(--night-2); transition: border-color .4s var(--ease), box-shadow .5s var(--ease), transform .6s var(--ease); }
.pf-card__shot img { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: 0 0; transition: transform 1.1s var(--ease); }
.pf-card:hover .pf-card__shot, .pf-card:focus-visible .pf-card__shot { border-color: var(--sodium); box-shadow: 0 0 0 1px var(--sodium), 0 20px 60px -24px rgb(255 138 61 / .55); transform: translateY(-4px); }
.pf-card:hover img { transform: scale(1.025); }
.pf-card__meta { display: grid; gap: 2px; margin-top: 13px; }
.pf-card__name { font-family: var(--f-display); font-weight: 700; font-size: var(--step-1); line-height: 1.15; }
.pf-card__type { grid-row: 2; color: var(--mist); }
.pf-card.is-hero .pf-card__shot { visibility: hidden; }
@media (min-width: 900px) {
	.pf-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
	.pf-item--a { grid-column: 1 / 8; }
	.pf-item--b { grid-column: 8 / 13; margin-top: 110px; }
	.pf-item--c { grid-column: 2 / 6; }
	.pf-item--d { grid-column: 6 / 13; margin-top: -40px; }
	.pf-item--e { grid-column: 1 / 8; margin-top: -30px; }
	.pf-item--f { grid-column: 8 / 12; margin-top: 70px; }
	.pf-item--a .pf-card__shot img, .pf-item--d .pf-card__shot img, .pf-item--e .pf-card__shot img { aspect-ratio: 16 / 10; }
	.pf-item--b .pf-card__shot img, .pf-item--f .pf-card__shot img, .pf-item--c .pf-card__shot img { aspect-ratio: 4 / 3.4; }
}

.pf-cta { position: relative; z-index: 1; padding-block: clamp(80px, 12vw, 170px); text-align: center; }
.pf-cta__title { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: var(--step-display); line-height: 1.02; }
.pf-cta p { max-width: 38em; margin: 18px auto 28px; }

/* ---- The preview dialog ---- */
.pv { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: none; color: var(--bone); overflow: hidden; }
.pv::backdrop { background: rgb(7 11 20 / .84); opacity: 0; transition: opacity .35s; }
.pv.is-open::backdrop { opacity: 1; }
.pv__panel { position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--night-2); transform-origin: 0 0; will-change: transform; }
.pv__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--rule); }
.pv__id { min-width: 0; }
.pv__name { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 1.0625rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv__tag { margin: 0; font-family: var(--f-mono); font-size: .6875rem; color: var(--halo); }
.pv__tools { flex: none; display: flex; align-items: center; gap: 5px; }
.pv__seg { display: flex; border: 1px solid var(--rule); border-radius: 9px; overflow: hidden; }
.pv__seg button { min-height: 42px; padding: 0 12px; background: none; border: 0; color: var(--mist); font: inherit; font-size: .875rem; cursor: pointer; }
.pv__seg button[aria-pressed="true"] { background: var(--bone); color: var(--ink); }
.pv__icon { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; background: none; border: 1px solid var(--rule); border-radius: 9px; color: var(--bone); cursor: pointer; transition: border-color .2s, color .2s; }
.pv__icon:hover { border-color: var(--sodium); color: var(--sodium); }
.pv__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pv :focus-visible { outline: 2px solid var(--sodium); outline-offset: 2px; }
.pv__stage { position: relative; min-height: 0; overflow: hidden; background: var(--night); }
.pv__device { position: absolute; left: 50%; top: 50%; overflow: hidden; background: var(--night); transform-origin: 0 0; }
.pv__device.is-phone { border-radius: 34px; box-shadow: 0 0 0 8px #1a2136, 0 0 0 9px var(--rule); }
/* The screenshot leaves before the live site arrives: a site's opening animation laid over its own still reads as two sites. */
.pv__device iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; }
.pv__device.is-live iframe { opacity: 1; transition: opacity .3s .2s; }
.pv__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transition: opacity .18s; }
.pv__device.is-live .pv__poster { opacity: 0; }
.pv__note { max-height: 46dvh; overflow-y: auto; border-top: 1px solid var(--rule); padding: 0 14px; }
.pv__note summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.pv__note dl { margin: 0 0 12px; display: grid; gap: 9px; }
.pv__note dt { font-family: var(--f-mono); font-size: .75rem; color: var(--halo); }
.pv__note dd { margin: 0; }
.pv__note .btn { margin-bottom: 16px; }
.pv.is-entering .pv__bar, .pv.is-entering .pv__note, .pv.is-entering .pv__stage > * { opacity: 0; }
.pv__bar, .pv__note, .pv__stage > * { transition: opacity .3s; }

/* Phones get a full screen, with the tools on their own row */
@media (max-width: 559px) { .pv__bar { flex-wrap: wrap; } .pv__id { flex: 1 0 100%; } .pv__tools { flex: 1; } .pv__seg { margin-right: auto; } }
@media (min-width: 1000px) {
	.pv__panel { inset: 2.5vh 2.5vw; grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto minmax(0, 1fr); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; }
	.pv__bar { grid-column: 1 / -1; padding: 10px 16px; }
	.pv__name { font-size: 1.3rem; }
	.pv__note { max-height: none; border-top: 0; border-left: 1px solid var(--rule); padding: 16px 18px; }
	.pv__note summary { pointer-events: none; list-style: none; min-height: 0; font-family: var(--f-display); font-size: 1.2rem; margin-bottom: 12px; }
	.pv__note summary::-webkit-details-marker { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.pf-card__shot, .pf-card__shot img { transition: none; }
	.pf-card:hover .pf-card__shot { transform: none; }
	.pf-card:hover img { transform: none; }
}
