/*
 * Persiss — Works (07): case study page (single-works.php).
 * cover → challenge → idea → process → deliverables + palette → credits → next.
 * The cover arch widens and softens as you scroll; every image sits in the same arch language.
 * Works without a case page get the light layout at the end (.lite).
 */
.c-crumbs { padding-top: 22px; }
.crumbs span[aria-hidden] { opacity: .5; }

.c-head { padding-block: clamp(28px, 6svh, 64px) clamp(28px, 5svh, 48px); display: grid; gap: 14px; }
.c-head h1 { font-family: var(--f-ja); font-size: clamp(32px, 8.4vw, 68px); line-height: 1.28; }
.c-head__sub { font-family: var(--f-ja); font-size: clamp(16px, 4.2vw, 21px); color: var(--ink-soft); }
.c-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); margin-top: 10px; }
.c-meta div { padding: 14px 10px 0 0; min-width: 0; }
.c-meta dt { font-size: 11.5px; color: var(--muted); letter-spacing: .1em; }
.c-meta dd { font-family: var(--f-ja); font-weight: 600; font-size: clamp(14px, 3.6vw, 17px); line-height: 1.5; }

/* cover scene */
.c-cover { position: relative; height: 165svh; }
.c-cover__stick { position: sticky; top: calc(var(--nav-h) + env(safe-area-inset-top, 0px)); height: calc(100svh - var(--nav-h) - env(safe-area-inset-top, 0px)); display: grid; place-items: center; overflow: hidden; }
.c-cover__band { position: absolute; inset: 8% 0; background: var(--paper); transform: scaleX(var(--bx, 1)); border-radius: calc((1 - var(--p, 0)) * 40px); }
.c-cover__frame {
	position: relative; z-index: 1; width: min(calc(100vw - 32px), calc((100svh - 150px) * var(--ar)), 1100px); aspect-ratio: var(--ar); max-width: 100%;
	overflow: hidden; background: var(--paper);
	border-radius: calc(var(--rad, 999px) * (1 - var(--p, 0)) + 22px * var(--p, 0)) calc(var(--rad, 999px) * (1 - var(--p, 0)) + 22px * var(--p, 0)) 22px 22px;
	transform: scale(calc(.84 + var(--p, 0) * .16));
}
.c-cover__frame img { width: 100%; height: 100%; object-fit: cover; transform: scale(calc(1.14 - var(--p, 0) * .14)); }
.c-cover__frame--contain img { object-fit: contain; padding: 4% 6%; }
.c-cover__note { position: absolute; z-index: 2; bottom: 14px; left: 50%; translate: -50% 0; font-size: 11.5px; color: var(--muted); white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; }

/* text blocks */
.blk { padding-block: clamp(72px, 14svh, 150px) 0; }
.blk__label { display: flex; gap: 12px; align-items: baseline; margin-bottom: 18px; }
.blk__label b { font-family: var(--f-ja); font-weight: 600; font-size: 15px; }
.statement { font-family: var(--f-ja); font-weight: 600; font-size: clamp(23px, 5.8vw, 44px); line-height: 1.7; max-width: 22em; letter-spacing: .02em; }
.body { color: var(--ink-soft); max-width: 36em; font-size: clamp(15px, 3.9vw, 17px); line-height: 2.05; }
.idea { display: grid; gap: clamp(28px, 5vw, 64px); align-items: start; }
.idea__wide { margin-top: clamp(36px, 6svh, 64px); }
.idea__media { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 900px) { .idea { grid-template-columns: 5fr 7fr; } .idea .body { position: sticky; top: 120px; } }
.cap { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.detail > img { transform-origin: var(--o, 50% 50%); scale: var(--z, 1); }
.frame--crop > img { object-fit: cover; object-position: var(--o, 50% 50%); height: 100%; }

/* process */
.steps { display: grid; gap: clamp(40px, 7svh, 64px); margin: 0; padding: 0; list-style: none; }
@media (min-width: 900px) {
	.steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
	.steps--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
	.steps--1 { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
}
.step { display: grid; gap: 14px; align-content: start; min-width: 0; }
.step__n { font-family: var(--f-latin); font-style: italic; font-size: 15px; color: var(--accent); }
.step h3 { font-family: var(--f-ja); font-size: clamp(20px, 5vw, 24px); }
.step p { color: var(--ink-soft); font-size: 14.5px; line-height: 1.95; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pair figcaption { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.ph { aspect-ratio: 4 / 5; border-radius: var(--arch); display: grid; place-items: center; text-align: center; padding: 20%; color: var(--muted); font-size: 12.5px; line-height: 1.7; background: repeating-linear-gradient(-45deg, transparent 0 9px, rgba(var(--faint-rgb), .45) 9px 10px); box-shadow: inset 0 0 0 1.5px var(--faint); }
.ph b { display: block; font-family: var(--f-ja); font-size: 15px; color: var(--ink-soft); margin-bottom: 4px; }

/* logo construction (exact artwork, guides only drawn) */
.construct { position: relative; aspect-ratio: 4 / 5; border-radius: var(--arch); background: #fff; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.construct img { position: absolute; inset: 14% 12% 10%; width: 76%; height: 76%; object-fit: contain; }
.construct svg { position: absolute; inset: 14% 12% 10%; width: 76%; height: 76%; overflow: visible; }
.construct svg * { fill: none; stroke: var(--accent); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .75; }
.construct svg .soft { stroke-dasharray: 1; opacity: .45; }
.construct.in svg * { animation: cDraw 1.8s var(--ease) forwards; animation-delay: var(--gd, 0ms); }
.construct.in img { animation: cReveal 1.8s var(--ease) backwards; animation-delay: 1.1s; }
.construct.in svg { animation: cFade 1.2s ease forwards; animation-delay: 3.4s; }
@keyframes cDraw { to { stroke-dashoffset: 0; } }
@keyframes cReveal { from { clip-path: circle(0% at 50% 29%); } to { clip-path: circle(100% at 50% 29%); } }
@keyframes cFade { to { opacity: .22; } }
.replay { margin-top: 10px; border: 0; background: transparent; cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 700; min-height: 36px; padding: 0; }
.mono { aspect-ratio: 4 / 5; border-radius: var(--arch); background: var(--mono, var(--accent)); display: grid; place-items: center; overflow: hidden; }
.mono img { width: 70%; height: 70%; object-fit: contain; filter: brightness(0) invert(1); }
.logo-tile { aspect-ratio: 4 / 5; border-radius: var(--arch); background: #fff; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); }
.logo-tile img { width: 70%; height: 70%; object-fit: contain; }

/* live site in a laptop frame */
.lap { min-width: 0; }
.lap__screen { position: relative; border: clamp(6px, 1.4vw, 11px) solid #23201C; border-bottom-width: clamp(10px, 2vw, 16px); border-radius: 14px 14px 4px 4px; background: var(--screen); aspect-ratio: 16 / 10; overflow: hidden; }
.lap__scroll { position: absolute; inset: 0; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; }
.lap__scroll::-webkit-scrollbar { display: none; }
.lap__scroll img { width: 100%; }
.lap__base { height: clamp(8px, 1.4vw, 13px); margin-inline: -7%; border-radius: 2px 2px 14px 14px; background: linear-gradient(#E3DDD3, #B8B0A3); position: relative; }
.lap__base::before { content: ""; position: absolute; left: 50%; top: 0; width: 16%; height: 40%; translate: -50% 0; border-radius: 0 0 8px 8px; background: #A79F92; }
.lap__bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }
.lap__name { font-family: var(--f-ja); font-weight: 600; font-size: 15px; }
.lap__btn { width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; background: var(--paper); display: grid; place-items: center; font-size: 12px; }
.lap__btn:hover { background: var(--paper-2); }
.laps { display: grid; gap: 36px 28px; padding-inline: 4%; }
@media (min-width: 760px) { .laps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* phone frame + device pair (real screenshots) */
.mob .lap__screen { aspect-ratio: 390 / 844; border-width: 8px; border-radius: 30px; }
.mob .lap__screen::before { content: ""; position: absolute; z-index: 2; top: 6px; left: 50%; width: 30%; height: 14px; translate: -50% 0; border-radius: 999px; background: #23201C; }
.devices { display: grid; gap: 28px; align-items: end; grid-template-columns: minmax(0, 1fr); }
.devices .mob { width: min(62%, 260px); justify-self: center; }
@media (min-width: 760px) { .devices { grid-template-columns: minmax(0, 3.2fr) minmax(0, 1fr); gap: 36px; } .devices .mob { width: 100%; } }
.siteln { margin-top: 6px; }
.siteln .pill { box-shadow: inset 0 0 0 1.5px var(--faint); }
.siteln .pill:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.siteln .pill span { font-weight: 500; color: var(--muted); font-size: 12px; }
.feats { display: grid; gap: 14px; }
@media (min-width: 700px) { .feats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .feats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.feat { background: var(--paper); border-radius: 20px; padding: 18px 20px; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 4px 14px; align-content: start; }
.feat::before { content: ""; grid-row: span 2; width: 14px; height: 18px; margin-top: 6px; border-radius: 999px 999px 3px 3px; background: var(--accent); }
.feat b { font-family: var(--f-ja); font-size: 17px; }
.feat span { color: var(--ink-soft); font-size: 14px; line-height: 1.85; }
.tree { display: flex; flex-wrap: wrap; gap: 8px; padding: 22px; border-radius: var(--arch); background: var(--paper); justify-content: center; align-content: center; aspect-ratio: 4 / 5; }
.tree em { width: 100%; text-align: center; font-style: normal; font-family: var(--f-latin); font-size: 15px; margin-bottom: 6px; }
.tree span { font-size: 13px; padding: 4px 12px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--faint); }

.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 24px; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 0; cursor: pointer; min-height: 38px; padding: 0 16px; border-radius: 999px; background: transparent; box-shadow: inset 0 0 0 1.2px var(--faint); font-size: 13.5px; color: var(--ink-soft); white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 3vw, 36px); margin-top: 28px; max-width: 860px; }
.trio .mob .lap__screen { border-width: clamp(4px, 1vw, 8px); border-radius: clamp(16px, 4vw, 30px); }
.trio .lap__btn { display: none; }
.trio .lap__name { font-size: 13px; }
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pgrid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: 999px 999px 10px 10px; background: var(--paper); }

/* deliverables + palette */
.split { display: grid; gap: clamp(48px, 8svh, 64px); }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 64px; } }
.deliv { margin: 0; padding: 0; list-style: none; }
.deliv li { display: flex; gap: 14px; padding-block: 14px; border-bottom: 1px solid var(--line); font-family: var(--f-ja); font-size: 16.5px; font-weight: 600; }
.deliv li::before { content: ""; flex: none; width: 10px; height: 13px; margin-top: .6em; border-radius: 999px 999px 2px 2px; background: var(--accent); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px; }
.sw { display: grid; gap: 8px; }
.sw i { display: block; aspect-ratio: 4 / 5; border-radius: var(--arch); background: var(--c); box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb), .08); transform-origin: 50% 100%; }
.sw.rv.in i { animation: swUp .9s var(--ease) backwards; animation-delay: var(--d, 0ms); }
@keyframes swUp { from { transform: scaleY(.15); } to { transform: none; } }
.sw b { font-family: var(--f-ja); font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.sw code { font-family: var(--f-latin); font-size: 12px; color: var(--muted); }
.pal-note { margin-top: 14px; font-size: 12px; color: var(--muted); }

/* credits */
.credits { display: grid; grid-template-columns: minmax(0, 7em) minmax(0, 1fr); border-top: 1px solid var(--ink); }
.credits dt, .credits dd { padding-block: 14px; border-bottom: 1px solid var(--line); }
.credits dt { font-size: 13px; color: var(--muted); }
.credits dd { font-family: var(--f-ja); font-weight: 600; min-width: 0; }
.credits a:hover { color: var(--accent); }

/* next */
.next { display: grid; gap: 20px; justify-items: center; text-align: center; padding-block: clamp(90px, 16svh, 160px) clamp(70px, 12svh, 120px); margin-top: clamp(90px, 16svh, 160px); border-top: 1px solid var(--line); }
.next .frame { width: min(64vw, 300px); }
.next h2 { font-family: var(--f-ja); font-size: clamp(24px, 6vw, 40px); }
.next:hover .frame > img { transform: scale(1.05); }

/* works without a case page */
.lite { display: grid; gap: clamp(20px, 4vw, 36px); padding-bottom: clamp(40px, 8svh, 80px); }
.lite__imgs { display: grid; gap: 16px; }
@media (min-width: 900px) { .lite__imgs--n { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.lite__imgs .frame--flat { background: var(--paper); }
.lite__imgs .frame--site { aspect-ratio: auto; max-height: 80svh; overflow-y: auto; border-radius: 16px; container-type: normal; }
.lite__about { color: var(--ink-soft); max-width: 36em; font-size: clamp(15px, 3.9vw, 16.5px); line-height: 2; }
.lite__note { color: var(--muted); font-size: 13px; }
.lite__note a { color: var(--accent); }

/* Persian: right-to-left text inside the unchanged layout */
html[lang="fa"] :is(.c-head__sub, .statement, .body, .feat b, .feat span, .lap__name, .tree span, .ph span, .cap, .pal-note, .lite__note, .lite__about) { direction: rtl; }

@media (prefers-reduced-motion: reduce) {
	.c-cover { height: auto; }
	.c-cover__stick { position: relative; top: 0; height: auto; padding-block: 24px 48px; }
	.c-cover__band { display: none; }
	.c-cover__frame { --p: 1 !important; width: min(calc(100vw - 32px), 1100px, calc(80svh * var(--ar))); }
	.c-cover__note { position: static; translate: none; display: block; text-align: center; margin-top: 10px; }
	.construct svg * { stroke-dashoffset: 0; opacity: .3; }
	.construct.in svg *, .construct.in img, .construct.in svg, .sw.rv.in i { animation: none; }
	.replay, .lap__btn { display: none; }
}

/* Links to the matching service page and contact at the end of a work (SEO-SPEC-02 item 9). */
.c-links { display: grid; gap: 14px; justify-items: center; text-align: center; margin-top: clamp(70px, 12svh, 120px); }
.c-links__h { color: var(--muted); font-size: 13px; letter-spacing: .06em; }
.c-links__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; }
.c-links + .next { margin-top: clamp(50px, 9svh, 90px); }
