/* I MADE A BUG: Work page (work-v1). Loaded after the homepage stylesheets; reuses their tokens, type and colours.
   Editorial rows: the real project art carries the page, image and text alternate sides, nothing is boxed. */

.work-head .wrap { text-align: center; padding-top: clamp(56px, 8vw, 112px); padding-bottom: clamp(36px, 5vw, 64px); }
.work-head h1 { font: 700 clamp(44px, 6vw, 84px)/.95 var(--display); text-transform: uppercase; letter-spacing: .005em; text-wrap: balance; }
.work-head .lead { margin: 22px auto 0; max-width: 36em; font-size: clamp(16px, 1.3vw, 18px); line-height: 1.62; color: var(--muted); text-wrap: pretty; }
.work-head .jump { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; font-size: 14px; font-weight: 500; }

/* labels */
.status { display: inline-flex; align-items: center; gap: 9px; font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  padding: 7px 11px 7px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(165,255,61,.5); color: var(--lime); }   /* available: Out now = lime */
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.status.soon { color: #E2B451; box-shadow: inset 0 0 0 1px rgba(226,180,81,.5); }   /* not yet available: Coming soon = muted amber */
.tags { margin-top: 14px; font: 400 12px/1.6 var(--mono); letter-spacing: .04em; color: var(--faint); }
.tags span + span::before { content: "·"; margin: 0 .7em; }

/* project rows */
.projects { padding-bottom: var(--sec); }
.proj { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 76px); align-items: center; padding: clamp(40px, 5.5vw, 76px) 0; scroll-margin-top: 80px; }
.proj + .proj { border-top: 1px solid var(--line); }
.proj.flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
.proj.flip .media { order: 2; }
.proj h2 { font: 700 clamp(32px, 3.6vw, 50px)/1 var(--display); text-transform: uppercase; letter-spacing: .005em; margin-top: 18px; }
.proj .d { margin-top: 16px; font-size: clamp(16px, 1.2vw, 17.5px); line-height: 1.65; color: rgba(237,237,237,.84); max-width: 30em; text-wrap: pretty; }
.proj .feat { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.proj .feat li { font: 400 12px/1 var(--mono); letter-spacing: .03em; color: var(--muted); padding: 8px 10px; border-radius: 4px; background: rgba(237,237,237,.06); }
.proj .credit { margin-top: 18px; font-size: 13.5px; color: var(--faint); }
.proj .links { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 14.5px; font-weight: 500; }

/* art panels (same compositions as the homepage cards, larger) */
.media .art { position: relative; border-radius: 4px; overflow: hidden; background: var(--panel); aspect-ratio: 3 / 2; }
.media .art > * { transition: transform .6s var(--ease); }
.proj:hover .media .art > img { transform: scale(1.025); }
.art-ataxx-wide { aspect-ratio: 16 / 9 !important; background: url("ataxx-bg.jpg") center / cover !important; }   /* the official transparent promo on the game's own blue (same as Services) */
.art-ataxx-wide img { width: 100%; height: 100%; object-fit: cover; }
.media .art-tapfast .phone, .media .art-ataxx .phone { height: 104%; }
.proj:hover .media .art-tapfast .phone { transform: translateX(-50%) rotate(-4deg) scale(1.025); }

/* featured: Lendas da Madeira (coming soon: finished, awaiting release) */
.proj.feature { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); padding-top: clamp(24px, 3vw, 40px); }
.feature .art-ldm { aspect-ratio: 16 / 10; }
.feature .art-ldm .map { width: 82%; }
.feature .art-ldm .map, .proj:hover .media .art-ldm .map { transform: translate(-50%, -50%); transition: none; }   /* the island stays centred and still on hover (the generic card zoom dropped its centring offset) */
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.shots img { width: 100%; aspect-ratio: 478 / 196; object-fit: cover; border-radius: 4px; background: var(--panel); }
.feature .ask { margin-top: 22px; font-size: 14.5px; font-weight: 500; }

@media (max-width: 860px) {
  .proj, .proj.flip, .proj.feature { grid-template-columns: 1fr; gap: 26px; }
  .proj.flip .media { order: 0; }
  .proj h2 { margin-top: 14px; }
  .shots { gap: 8px; margin-top: 8px; }
}
@media (max-width: 760px) {
  .proj { padding: 40px 0; }
}
@media (prefers-reduced-motion: reduce) { .media .art > * { transition: none; } }
.skiplink { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--lime); color: var(--charcoal); font-weight: 700; font-size: 14px; padding: 10px 14px; border-radius: 4px; text-decoration: none; }
.skiplink:focus { top: 12px; }
.media .art-wordsort { aspect-ratio: 16 / 9; }                 /* the key art is 16:9: no crop of "Word play that flows" */
.site-nav ul a[aria-current="page"] { color: var(--white); box-shadow: inset 0 -1px 0 var(--lime); padding-bottom: 3px; }
.feature .art-ldm .map, .shots img { height: auto; }        /* width/height attributes reserve space; CSS keeps the ratio */
/* work-v4: V2's "Bug behind the heading" language, Bug on the LEFT, two compositions (html.comp-a / html.comp-b; see work-bug.js).
   Shared: the H1 sits above the Bug's canvas (z 55 vs 50; nav 60). A charcoal stroke painted under each letter (paint-order) is
   invisible on the page and only shows as a clean cut-out edge where a letter crosses the full-colour Bug (as in V2). */
.work-head { --h1: clamp(44px, 6vw, 84px); }
.work-head h1 { position: relative; z-index: 55; -webkit-text-stroke: .07em var(--charcoal); paint-order: stroke fill; }
.work-head h1 .perch { display: inline-block; width: 0; height: 0; vertical-align: baseline; position: relative; -webkit-text-stroke: 0;
  --op: 1; --fade-a: 100%; --fade-b: 100%; }
.work-head h1 .perch-still { position: absolute; z-index: -1; width: calc(var(--s) * 1.25); height: auto; max-width: none; opacity: var(--op);
  -webkit-mask-image: linear-gradient(to bottom, #000 var(--fade-a), transparent var(--fade-b)); mask-image: linear-gradient(to bottom, #000 var(--fade-a), transparent var(--fade-b));
  left: calc(var(--sx) - var(--s) * 0.625); top: calc(var(--sy) - var(--s) * 0.625); pointer-events: none; user-select: none; }
html.work-bug-live .work-head h1 .perch-still { visibility: hidden; }
.comp-a .work-head h1 .still-b, .comp-b .work-head h1 .still-a { display: none; }   /* one still per composition (A has the folded wing) */

/* A: golden-ratio split. Text column starts at 38%; the heading hangs 1.1em back over the Bug; the Bug anchors the left 38%.
   The baseline crosses the Bug at 62% of its height (the golden point, just under its eyes). */
.comp-a .work-head .wrap { text-align: left; padding-top: calc(var(--h1) * 2.9 + 12px); padding-bottom: clamp(48px, 6vw, 88px); }
.comp-a .work-head h1 { margin-left: calc(38% - 0.6em); }
.comp-a .work-head .lead { margin: 22px 0 0 38%; }
.comp-a .work-head .jump { margin-left: 38%; justify-content: flex-start; }
.comp-a .work-head h1 .perch { --s: min(4.8em, 400px); --sx: calc(-4.45em - 0.27 * var(--s)); --sy: calc(-0.72em - 0.1 * var(--s)); }
@media (max-width: 599px) {   /* mobile A: the Bug + heading share the first row (38/62); paragraph and links use the full width */
  .comp-a .work-head .lead, .comp-a .work-head .jump { margin-left: 0; }
  .comp-a .work-head h1 .perch { --fade-a: calc(var(--s) * 0.745 + 0.1em); --fade-b: calc(var(--s) * 0.745 + 0.55em); }
}

/* B: the heading stays centred; a large Bug on the left overlaps the start of "OUR" from behind; its lower body fades out
   before the paragraph. */
.comp-b .work-head .wrap { padding-top: calc(var(--h1) * 2.6 + 12px); }
.comp-b .work-head h1 .perch { --s: min(4.3em, 360px); --sx: calc(-4.45em - 0.27 * var(--s)); --sy: calc(-0.72em - 0.1 * var(--s));
  --fade-a: calc(var(--s) * 0.745 + 0.1em); --fade-b: calc(var(--s) * 0.745 + 0.55em); }

/* work-v5: supporting graphics on the right (decorative). Drawn from the Bug's own shapes: a faint ring, a tilted lime orbit
   with a break (a wing's curve in flight), one antenna stalk + ball with a soft glow, a wing-leaf outline, a few dots.
   html.deco-a = graphics only; html.deco-b = graphics + two small mono labels (the 01—04 index was removed in v6).
   Placed with the heading's size: the orbit ends just above the paragraph and right of the heading. */
.work-head .wrap { position: relative; }
.orbit { --orb: clamp(240px, 24vw, 340px); position: absolute; z-index: 0; right: var(--gutter); width: var(--orb); aspect-ratio: 1;
  top: calc(var(--h1) * 3.7 + 12px - var(--orb) * 0.92); pointer-events: none; }
.comp-b .orbit { top: calc(var(--h1) * 3.4 + 12px - var(--orb) * 0.92); }
.orbit svg { display: block; width: 100%; height: 100%; overflow: visible; }
.orbit svg * { vector-effect: non-scaling-stroke; }
.o-lines { opacity: .2; }                                  /* v6: the illustration sits in the background (~20%) */
.o-ring { fill: none; stroke: #EDEDED; stroke-width: .75; }
.o-ring-in { stroke-dasharray: 1 7; stroke-linecap: round; opacity: .7; }
.o-orbit { fill: none; stroke: var(--lime); stroke-width: .8; }
.o-wing { fill: none; stroke: var(--lime); stroke-width: .75; }
.o-stalk { fill: none; stroke: var(--lime); stroke-width: .9; stroke-linecap: round; }
.o-ball { fill: var(--lime); opacity: .55; }
.o-dot { fill: var(--lime); opacity: .5; } .o-dot-f { opacity: .3; }
.o-drift { transform-box: view-box; transform-origin: 200px 200px; animation: orb-drift 90s linear infinite; }
@keyframes orb-drift { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .o-drift { animation: none; } }
.o-arc { font: 500 10.5px var(--mono); letter-spacing: 3.4px; text-transform: uppercase; fill: #EDEDED; }
.orbit-label { position: absolute; left: 4%; top: 2%; font: 500 11px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: rgba(237,237,237,.5); white-space: nowrap; }
.orbit-label::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); margin-right: 10px; vertical-align: 1px; }
/* variant A: graphics only */
.deco-a .orbit-label, .deco-a .o-arc { display: none; }
/* tablet: a smaller orbit, labels stay */
@media (max-width: 1100px) { .orbit-label { display: none; } }   /* not enough height above the orbit: the arc text and index carry it */
/* mobile: only a small, faint orbit fragment in the free top-right corner; no labels or index */
@media (max-width: 599px) {
  .orbit { --orb: 124px; right: 6px; top: calc(var(--h1) * 3.7 + 12px - var(--h1) * 0.72 - 132px); opacity: .7; }
  .orbit-label, .o-arc, .o-wing { display: none; }
}

/* work-v6: the homepage's dark background texture (rules in texture.css, extended to these elements):
   intro = the hero recipe (fine grain + soft ambient light, centred on the Bug), project showcase = the dark-section recipe
   (Bug-line pattern at 4% with the edge fade), lime Contact = unchanged. No isolation here: the layers sit in the page's
   background layer, so they stay BEHIND the Bug's canvas and the heading stays in front of the Bug. */
.tex .work-head, .tex .projects { position: relative; }
.tex .work-head::before, .tex .projects::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
/* the hero's ambient light (same values as .tex2 .hero::before), centred on the Bug instead of the page centre */
.tex2 .work-head::before { background: radial-gradient(circle 190px at var(--lx) var(--ly), rgba(237,237,237,.035), rgba(237,237,237,0) 100%),
  radial-gradient(ellipse 820px 560px at var(--lx) var(--ly), rgba(237,237,237,.055), rgba(237,237,237,.018) 45%, rgba(237,237,237,0) 72%),
  radial-gradient(ellipse 460px 320px at var(--lx) calc(var(--ly) - 10px), rgba(165,255,61,.03), rgba(165,255,61,0) 70%); }
.work-head { --lx: calc(50% - 380px); --ly: calc(var(--h1) * 2.98 - 28px); }   /* the Bug's centre: ~100px above the baseline */
@media (max-width: 1100px) { .work-head { --lx: 26%; } }
@media (max-width: 760px) {
  .tex2 .work-head::before { background: radial-gradient(circle 130px at var(--lx) var(--ly), rgba(237,237,237,.035), rgba(237,237,237,0) 100%),
    radial-gradient(ellipse 480px 400px at var(--lx) var(--ly), rgba(237,237,237,.055), rgba(237,237,237,.018) 45%, rgba(237,237,237,0) 72%),
    radial-gradient(ellipse 320px 230px at var(--lx) calc(var(--ly) - 10px), rgba(165,255,61,.03), rgba(165,255,61,0) 70%); }
  .work-head { --lx: 22%; }
}
/* the homepage hero ends at a lime band; here the intro flows straight into the dark showcase, so its grain and light
   dissolve over the last 30% instead of stopping in a straight line */
.tex .work-head::before, .tex .work-head::after { -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent); mask-image: linear-gradient(to bottom, #000 70%, transparent); }

/* Scan Easier (5th project): the official Google Play screens cut from their store frames, on the app's own blue
   (sampled from its icon), composed like Tap Fast: icon top-left, phones rising from the bottom edge */
.media .art-scaneasier { background: radial-gradient(120% 90% at 78% 8%, #3d8bff 0%, #2878f4 38%, #1a55d6 100%); }
.media .art-scaneasier .icon { position: absolute; left: 5%; top: 7%; width: 15%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 22%; box-shadow: 0 8px 22px rgba(4,20,70,.35); }
.media .art-scaneasier .phone { position: absolute; height: 106%; width: auto; max-width: none; bottom: -26%; filter: drop-shadow(0 18px 30px rgba(4,20,70,.45)); }
.media .art-scaneasier .phone.front { left: 36%; transform: rotate(-4deg); }
.media .art-scaneasier .phone.back { left: 60%; bottom: -32%; height: 98%; transform: rotate(6deg); }
.proj:hover .media .art-scaneasier .phone.front { transform: rotate(-4deg) scale(1.025); }
.proj:hover .media .art-scaneasier .phone.back { transform: rotate(6deg) scale(1.025); }
.proj .note { margin-top: 16px; font-size: 14.5px; line-height: 1.55; color: var(--muted); max-width: 30em; }
