/* The Work landing: the fade with the flight, the cards, the story. */
#page-work { --ink: #141414; --paper: #f4f1ea; --veil: rgba(244, 241, 234, .86); --red: #c7331f; --violet: #6032bb; --gold: #e2ad2b; scrollbar-color: rgba(199, 51, 31, .5) transparent; }
.wk { min-height: 100%; opacity: 0; transition: opacity 180ms ease-out; }
.page-in .wk { opacity: 1; transition: opacity 420ms cubic-bezier(.23, 1, .32, 1); }
/* pages.css fades loose words on landing pages; here the whole landing fades as one. */
#page-work .wk :is(h2, p) { opacity: 1; transform: none; transition: none; max-width: none; margin: 0; }
#page-work .wk a { text-decoration: none; }
#page-work .wk :is(a, button):focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 5px; }
#page-work .about-back { background: var(--veil); }

.wk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wk-story { display: grid; grid-template-columns: minmax(0, 62ch); justify-content: center; padding: clamp(48px, 9vh, 96px) clamp(16px, 5vw, 72px) clamp(72px, 14vh, 140px); }
.wk-tale { position: relative; isolation: isolate; padding: 20px 22px; font-size: clamp(14px, 1.15vw, 16px); line-height: 1.65; }
.wk-tale::before { content: ''; position: absolute; inset: -12px; z-index: -1; background: var(--veil); filter: blur(22px); }
#page-work .wk .wk-tale p + p { margin-top: 1em; }
#page-work .wk .wk-swap { display: flex; align-items: baseline; min-height: 1.1em; margin-bottom: .35em; font-weight: 700; font-size: clamp(30px, 5vw, 64px); line-height: 1.05; white-space: nowrap; color: var(--red); }
.wk-swap i { display: inline-block; width: .5em; height: .86em; margin-left: .06em; align-self: center; background: currentColor; animation: wk-blink 1.1s steps(1) infinite; }
@keyframes wk-blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) { .wk-swap i { animation: none; } }

.wk-head { padding: clamp(68px, 10vh, 92px) 16px clamp(20px, 4vh, 36px); text-align: center; overflow-x: clip; }
.wk-head > div { position: relative; isolation: isolate; display: inline-block; }
#page-work .wk-head h2 { font: 700 clamp(17px, 1.9vw, 26px)/1.3 'JetBrains Mono', monospace; letter-spacing: 0; }
#page-work .wk-head p { margin-top: 6px; font-size: 13px; color: var(--red); }

/* The sky thins out behind the title rather than sitting behind a shape, and still shows a little through it. */
.wk-head > div { padding: 8px 16px; }
.wk-head > div::before { content: ''; position: absolute; inset: -80% -45%; z-index: -1; background: radial-gradient(closest-side, rgba(244, 241, 234, .76) 66%, rgba(244, 241, 234, 0) 100%); }

.wk-table { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 32px clamp(32px, 5vw, 76px); padding: 0 clamp(12px, 3vw, 44px); }
.wk-hand h3 { position: relative; isolation: isolate; width: fit-content; margin: 0 auto 26px; padding: 3px 9px; font-size: 13px; font-weight: 700; }
.wk-hand h3::before { content: ''; position: absolute; inset: -60% -30%; z-index: -1; background: radial-gradient(closest-side, rgba(244, 241, 234, .9) 55%, rgba(244, 241, 234, 0) 100%); }
.wk-hand ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(10px, 1.2vw, 18px); margin: 0; padding: 0; }
.wk-hand li { flex: 0 0 clamp(150px, 14.6vw, 216px); transform: translateY(var(--y)) rotate(var(--r)); transition: transform 320ms cubic-bezier(.16, 1, .3, 1); }
#page-work .wk-face { position: relative; width: 100%; border: 0; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; aspect-ratio: 7 / 12; padding: 18px 16px 16px; border-radius: 8px; text-align: center; box-shadow: 0 16px 30px -14px rgba(20, 20, 20, .45); color: var(--fg); background: var(--bg); }
.wk-face::after { content: ''; position: absolute; inset: 7px; border: 1px solid currentColor; border-radius: 5px; pointer-events: none; }
.wk-num { font-size: 13px; font-weight: 700; letter-spacing: .08em; }
.wk-num em { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; padding: 0 4px; border: 1px solid currentColor; border-radius: 5px; font-style: normal; font-size: 10px; font-weight: 500; letter-spacing: 0; }
.wk-hand svg { flex: 1 1 0; min-height: 0; width: 72%; margin: 6px 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.wk-hand svg.wk-logo { stroke: none; }
.wk-logo .lf { fill: var(--fg); }
.wk-logo .lb { fill: var(--bg); }
.wk-hand b { font-size: clamp(16px, 1.5vw, 21px); line-height: 1.15; letter-spacing: -0.01em; }
.wk-desc { margin-top: 6px; font-size: clamp(12px, .9vw, 13px); line-height: 1.4; min-height: 5.6em; }
@media (hover: hover) { .wk-hand li:hover { transform: translateY(calc(var(--y) - 16px)) rotate(0deg); z-index: 2; } }
.wk-hand li:has(.wk-face:focus-visible) { transform: translateY(calc(var(--y) - 16px)) rotate(0deg); z-index: 2; }
.page-in .wk-hand li { animation: wk-deal 820ms cubic-bezier(.16, 1, .3, 1) backwards; animation-delay: calc(var(--i) * 95ms); }
@keyframes wk-deal { from { opacity: 0; transform: translate(calc(var(--o) * -104%), 46vh) rotate(0deg); } }

/* Side quests: the same cards at half the weight. */
.wk-small { margin-top: clamp(44px, 8vh, 72px); }
.wk-small li { flex-basis: clamp(128px, 11vw, 150px); }
#page-work .wk-small .wk-face { aspect-ratio: 7 / 10; padding: 16px 14px 14px; }
.wk-small b { font-size: 15px; }
.wk-small .wk-desc { min-height: 0; }

@media (max-width: 899px) {
  .wk-table { flex-direction: column; align-items: center; }
  .wk-hand li { flex-basis: min(43vw, 200px); }
  #page-work .wk-hand:not(.wk-small) .wk-face { aspect-ratio: 7 / 14; }
  .wk-hand svg { width: 56%; }
  .wk-small li { flex-basis: min(36vw, 150px); }
}
@media (prefers-reduced-motion: reduce) { .page-in .wk-hand li { animation: none; } .wk-hand li { transition: none; } }

/* A locked project: its tag carries a lock, and the card opens a look at the app. */
.wk-lock { width: 9px; height: 9px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.wk-hand svg.wk-lock { flex: none; width: 9px; margin: 0; }
.wk-peek { width: min(940px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 12px; overflow: auto; overscroll-behavior: contain; font-family: 'JetBrains Mono', monospace; color: var(--fg); background: var(--bg); box-shadow: 0 30px 80px -30px rgba(20, 20, 20, .7); }
.wk-peek::after { content: ''; position: absolute; inset: 9px; border: 1px solid currentColor; border-radius: 7px; opacity: .55; pointer-events: none; }
.wk-peek::backdrop { background: rgba(20, 20, 20, .5); }
.wk-peek.in { animation: wk-grow 460ms cubic-bezier(.16, 1, .3, 1); }
.wk-peek.in::backdrop { animation: wk-fade 300ms ease-out; }
.wk-peek.out { opacity: 0; transform: scale(.97); transition: opacity 200ms ease-in, transform 200ms ease-in; }
.wk-peek.out::backdrop { opacity: 0; transition: opacity 200ms ease-in; }
@keyframes wk-grow { from { transform: var(--from, scale(.9)); opacity: .4; border-radius: 30px; } }
@keyframes wk-fade { from { opacity: 0; } }
.wk-peek-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 30px 26px 6px 32px; }
.wk-peek-head b { display: block; font-size: clamp(20px, 2vw, 26px); letter-spacing: -0.01em; }
.wk-peek-head span { display: block; margin-top: 6px; font-size: 13px; line-height: 1.5; opacity: .8; }
.wk-peek button { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid currentColor; border-radius: 50%; color: inherit; background: none; cursor: pointer; transition: transform 160ms ease-out, opacity 160ms; }
.wk-peek button:active { transform: scale(.94); }
.wk-peek button:disabled { opacity: .3; cursor: default; }
.wk-peek button:focus-visible, .wk-reel:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.wk-peek button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wk-reel { display: flex; gap: 22px; margin: 0; padding: 18px 32px; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 32px; scrollbar-width: none; overscroll-behavior-x: contain; }
.wk-reel::-webkit-scrollbar { display: none; }
.wk-reel li { flex: none; scroll-snap-align: start; }
/* A phone: a dark bezel and a thin light rim so it reads on the ink. No island: the screens are the app's own top edge. */
.wk-phone { position: relative; margin: 0; height: min(58dvh, 540px); aspect-ratio: 494 / 1054; padding: 7px; border-radius: 40px; background: #050505; box-shadow: inset 0 0 0 1.5px rgba(244, 241, 234, .22), 0 22px 40px -18px rgba(0, 0, 0, .8); }
.wk-phone img { display: block; width: 100%; height: 100%; border-radius: 33px; object-fit: cover; background: #000; }
.wk-reel-nav { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 4px 0 28px; }
.wk-dots { display: flex; gap: 8px; }
.wk-dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .3; transition: opacity 200ms; }
.wk-dots i.on { opacity: 1; }
@media (max-width: 599px) {
  .wk-peek { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .wk-peek-head { padding: 26px 18px 2px 24px; }
  .wk-reel { gap: 16px; padding: 14px 24px; scroll-padding-inline: 24px; }
  .wk-phone { height: min(56dvh, 470px); border-radius: 34px; padding: 6px; }
  .wk-phone img { border-radius: 28px; }
}
@media (prefers-reduced-motion: reduce) { .wk-peek.in, .wk-peek.in::backdrop { animation: none; } .wk-peek.out, .wk-peek.out::backdrop { transition: none; } }
