/* Isabella Coletto — sticker desk.
   One paper desk, no scroll. The logo sticker peels off to reveal the printed category stickers.
   Printed stickers are pre-rendered canvases moved only with CSS transforms (cheap to animate).
   Colors and wiggle amounts below are defaults: main.js overwrites them from config.js. */
:root {
  --paper: #FAF2DF;   /* desk paper */
  --sheet: #FBF6EA;   /* the keyboard index panel's paper */
  --red: #B52429;
  --wine: #9B2428;
  --pink: #FFB6D8;
  --ink: #141010;
  --liner: #ECE3D1;   /* back of the sticker */
  --glue: #D9C68C;    /* adhesive residue */
  --wig: 5deg;        /* hover wiggle (projects, menu, back-sheet links) */
  --wig-soft: 2.2deg; /* hover wiggle (category cluster) */
  --wig-ms: 660ms;
  --f-body: 'DM Sans', system-ui, sans-serif;
  --f-mono: 'Fira Code', ui-monospace, Consolas, monospace;
  color-scheme: light;
  /* safe areas, read by main.js */
  --sat: env(safe-area-inset-top, 0px); --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px);
}

[hidden] { display: none !important }
/* text index (search engines, screen readers); it shows itself as a small panel when a keyboard user tabs into it */
.sr-only { position: fixed !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
.sr-only:focus-within {
  width: auto; height: auto; max-height: 70vh; overflow: auto; clip-path: none; white-space: normal;
  left: 16px; bottom: 16px; z-index: 20; max-width: min(360px, calc(100vw - 32px)); padding: 14px 18px;
  background: var(--sheet); box-shadow: 0 0 0 4px #fff, 0 8px 24px rgba(42, 15, 10, .3); font: 400 13px/1.5 var(--f-mono)
}
.sr-only h1 { font: 700 18px/1.2 var(--f-body); margin: 0 0 4px }
.sr-only h2 { font: 700 14px/1.2 var(--f-body); margin: 10px 0 2px; color: var(--wine) }
.sr-only ul { margin: 0; padding-left: 16px }
.sr-only a { color: var(--red) }
.sr-only a:focus-visible { outline: 2px dashed var(--red); outline-offset: 2px }
html, body { height: 100%; margin: 0 }
body {
  background-color: var(--paper);
  color: var(--ink);
  overflow: hidden;
  font-family: var(--f-body);
  touch-action: pinch-zoom;   /* one-finger drags belong to the site; pinch-zoom still works */
  user-select: none;
  -webkit-user-select: none;
}
body.grabbing, body.grabbing * { cursor: grabbing !important }
/* the mute sticker: bottom right of the desk, under the pop-up */
.stk.snd { position: fixed; right: calc(8px + var(--sar)); bottom: calc(6px + var(--sab)); z-index: 6 }
/* the language sticker (EN / PT): its twin, bottom left */
.stk.lng { position: fixed; left: calc(8px + var(--sal)); bottom: calc(6px + var(--sab)); z-index: 6 }
/* custom cursor (main.js, mouse only): drawn canvases that follow the pointer; the browser's cursor hides once it's on */
html.cur-on, html.cur-on * { cursor: none !important }
#cursor, #cursorSparks { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; will-change: transform }
#cursor canvas { display: block }
:focus { outline: none }

#bg, #desk, #big { position: fixed; inset: 0; width: 100%; height: 100%; display: block }
#bg { pointer-events: none }
#desk { pointer-events: none; overflow: hidden }
#big { pointer-events: none; z-index: 1; filter: drop-shadow(2px 8px 9px rgba(42, 15, 10, .24)) }
#big .hitArea { pointer-events: visiblePainted; cursor: grab }
#front:focus-visible #frontImg { filter: drop-shadow(0 0 8px var(--pink)) }

/* printed stickers */
.st { position: absolute; left: 0; top: 0; transform-origin: 50% 50%; will-change: transform; outline: none }
.st canvas { display: block; width: 100%; height: 100% }
.st-in { width: 100%; height: 100%; transform-origin: 50% 50% }
.st.hover .st-in, .st:focus-visible .st-in { animation: wig var(--wig-ms) steps(1, end) infinite }
.st:focus-visible canvas { filter: drop-shadow(0 0 6px var(--pink)) }
.st.hop .st-in { animation: hop .5s steps(1, end) }
/* the category cluster (categories + sobre/contato) wiggles softer */
.st.cat, .st.info { --wig: var(--wig-soft) }
@keyframes wig { 0% { transform: rotate(0) } 25% { transform: rotate(calc(-1 * var(--wig))) } 50% { transform: rotate(calc(.8 * var(--wig))) } 75% { transform: rotate(calc(-.5 * var(--wig))) } 100% { transform: rotate(0) } }
@keyframes hop { 0% { transform: none } 20% { transform: translateY(-8%) rotate(-4deg) } 45% { transform: translateY(-13%) rotate(3deg) } 70% { transform: translateY(-4%) rotate(-1deg) } 100% { transform: none } }

/* menu: one long printed sticker, always on */
#menu { position: fixed; left: 0; top: 0; z-index: 4; will-change: transform; transform-origin: 50% 50% }
#menu .menuIn { position: relative; width: 100%; height: 100% }
#menuPill { position: absolute; display: block }
#menuItems { position: absolute; inset: 0 }
.mi { position: absolute; cursor: pointer; outline: none }
.mi canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0 }
.mi .st-in { position: relative; width: 100%; height: 100%; transform-origin: 50% 50% }
.mi .on { display: none }
.mi.active .on { display: block }
.mi.active .off { display: none }
.mi:hover .st-in, .mi:focus-visible .st-in { animation: wig var(--wig-ms) steps(1, end) infinite }
.mi:focus-visible .st-in { filter: drop-shadow(0 0 5px var(--wine)) }

/* crumpled ball: one transparent WebGL canvas over the top band of the screen (height set by main.js);
   #ballFlat is the 2D stand-in while three.js loads; #home is the invisible hit area */
#ball3d, #ballFlat { position: fixed; left: 0; top: 0; width: 100%; height: 100%; display: block; pointer-events: none; z-index: 5 }
#home {
  position: fixed; z-index: 7; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
#home:focus-visible { outline: 3px dashed var(--pink); outline-offset: -8px }

/* back of the sticker: the uncrumpled ball with home / sobre / contato on top */
#sheet { position: fixed; z-index: 8; display: flex; align-items: center; justify-content: center; pointer-events: none }
#sheet.in { animation: sheetIn .35s ease-out both }
@keyframes sheetIn { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }
.sheetNav { display: flex; gap: clamp(14px, 3vw, 24px); flex-wrap: wrap; justify-content: center; pointer-events: auto; transform: rotate(-3deg) }
.sheetNav button {
  all: unset; cursor: pointer; font: 700 clamp(17px, 2vw, 22px)/1 var(--f-body); color: var(--wine);
  letter-spacing: -.01em; padding: 4px 2px; display: inline-block;
}
.sheetNav button:hover, .sheetNav button:focus-visible { animation: wig var(--wig-ms) steps(1, end) infinite; color: var(--red) }
.sheetNav button:focus-visible { outline: 2px dashed var(--red); outline-offset: 3px }

/* loading error only (empty otherwise) */
#note {
  position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); z-index: 2;
  font: 400 13px/1.4 var(--f-mono); color: var(--red);
  pointer-events: none; text-align: right; max-width: 60vw;
}
/* phones: the menu steps aside while the back sheet is open */
#menu { transition: opacity .25s }
@media (max-width: 699px), (max-height: 499px) {
  body.sheet-open #menu { opacity: 0; pointer-events: none }
}
/* ---------- pop-up: an open zine (projects, sobre, contato), built by main.js; values in config.js (zine) ---------- */
#modal { position: fixed; inset: 0; z-index: 10; touch-action: auto }
#modal .backdrop { position: absolute; inset: 0; background: rgba(42, 15, 10, .32); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); animation: fadeIn .25s ease-out both }
/* closing: the opening frames backwards, the backdrop (and the full view, if open) fading; nothing takes clicks meanwhile */
#modal.out, #modal.out * { pointer-events: none !important }
#modal.out .backdrop, #modal.out #lb { animation: fadeOut .3s ease-in both }
#modal.out #zine { animation: zineOut .3s steps(1, end) both }
@keyframes fadeIn { from { opacity: 0 } }
@keyframes fadeOut { to { opacity: 0 } }
@keyframes zineOut { 0% { transform: none } 25% { transform: scale(1.03) rotate(-1deg) } 50% { transform: scale(.75, .9) rotate(3deg) } 75% { transform: scale(.3, .55) rotate(-6deg) } 100% { transform: scale(.3, .55) rotate(-6deg); opacity: 0 } }
#zineHost { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none }
#zine { position: relative; width: var(--zw); height: var(--zh); pointer-events: auto; user-select: text; -webkit-user-select: text }
#zine.in { animation: zineIn .5s steps(1, end) both }
@keyframes zineIn { 0% { transform: scale(.3, .55) rotate(-6deg) } 30% { transform: scale(.75, .9) rotate(3deg) } 60% { transform: scale(1.03) rotate(-1deg) } 85% { transform: scale(.99) } 100% { transform: none } }
/* lifted a little off the desk: a contact shadow plus layered soft ones, a bit more under the outer halves (pages curve up) */
.z-shadow { position: absolute; inset: 0;
  box-shadow: 0 0 0 .5px rgba(30, 12, 8, .14), 0 1px 1.5px rgba(30, 12, 8, .22), 0 3px 6px rgba(30, 12, 8, .16), 0 9px 18px rgba(30, 12, 8, .14), 0 22px 44px rgba(30, 12, 8, .12), 0 40px 80px rgba(30, 12, 8, .08) }
.spread .z-shadow::before, .spread .z-shadow::after { content: ""; position: absolute; top: 6%; bottom: 2%; width: 30%; border-radius: 40%; box-shadow: 0 14px 30px rgba(30, 12, 8, .2); z-index: -1 }
.spread .z-shadow::before { left: 1%; transform: rotate(-1.2deg) } .spread .z-shadow::after { right: 1%; transform: rotate(1.2deg) }

.z-pages { position: absolute; inset: 0; perspective: 2400px; touch-action: none }
.slot { position: absolute; width: var(--pw); height: var(--ph); z-index: 1 }   /* own stacking context: nothing on the page below pokes through the turning leaf */
.spread .slot.b { left: var(--pw) } .cal .slot.b { top: var(--ph) }
.leaf { position: absolute; width: var(--pw); height: var(--ph); z-index: 3 }   /* a turning sheet: flat, hinged on the spine (flipTo) */
.shade { position: absolute; inset: 0; background: #1a120e; opacity: 0; pointer-events: none }

.page { position: absolute; inset: 0; background-size: 100% 100%; overflow: hidden }
.pad { position: absolute }
.flow { overflow: hidden; -webkit-mask-image: var(--m-body); mask-image: var(--m-body); -webkit-mask-size: 512px; mask-size: 512px }
.pad > .flow { position: relative; z-index: 1; padding: 14px; margin: -14px }   /* room for the slightly turned blocks, so their corners aren't cut off */
.flow > *:first-child { margin-top: 0 }
.z-scrap { position: absolute; z-index: 0; pointer-events: none }
.z-spine { position: absolute; inset: 0; z-index: 3; pointer-events: none; background-size: 100% 100% }
.z-title { position: relative; width: fit-content; max-width: 100%; margin: 0 0 .5em; padding: 8px 10px 2px 0; font: 700 var(--ts, 60px)/.9 var(--f-body); letter-spacing: -.035em; color: var(--red);
  text-wrap: balance; -webkit-mask-image: var(--m-title); mask-image: var(--m-title); -webkit-mask-size: 614px; mask-size: 614px }
.z-sub { margin: 0 0 1.1em; font: 700 calc(var(--fs) * .82)/1.4 var(--f-mono); color: var(--wine) }
.z-run { margin: 0 0 1em; font: 400 calc(var(--fs) * .78)/1.4 var(--f-mono); color: var(--wine) }
.z-p { margin: 0 0 .75em; font: 400 var(--fs)/1.5 var(--f-body); color: var(--ink) }
.z-meta { margin: 0 0 .6em; font: 700 calc(var(--fs) * .92)/1.45 var(--f-body) }
.z-p strong, .z-sub strong { font-weight: 700 }                           /* **bold** in conteudo.js */
.z-meta strong, .z-cr strong { color: var(--red) }                        /* (these lines are bold already: the mark shows as red) */
.z-meta span, .z-cr span, .z-credits h2 { display: block; font: 400 calc(var(--fs) * .74)/1.4 var(--f-mono); color: var(--wine) }
.z-meta span { font-weight: 700 }
.z-links { margin: .2em 0 .9em; display: flex; flex-wrap: wrap; gap: .3em 1em; font: 700 calc(var(--fs) * .92)/1.4 var(--f-body) }
.z-links a { color: var(--red); text-decoration: none; border-bottom: 2px solid var(--pink) }
.z-links a:hover { color: var(--wine) }
.z-credits { display: grid; grid-template-columns: 1fr 1fr; gap: .55em 1.1em; margin: .4em 0 0 }
.z-credits h2 { grid-column: 1 / -1; margin: 0; font-size: calc(var(--fs) * .8); letter-spacing: .04em }
.z-cr { font: 700 calc(var(--fs) * .84)/1.3 var(--f-body) }
/* contato: e-mail (with copy), instagram, behance, on their own page, centred top to bottom */
.pad > .flow.mid { height: 100%; display: flex; flex-direction: column; justify-content: center }
.z-contact { display: grid; gap: .9em; margin: .4em 0 0 }
.z-contact .row { display: flex; align-items: baseline; gap: .7em; flex-wrap: wrap }
.z-contact .lbl { font: 700 calc(var(--fs) * .74)/1.4 var(--f-mono); color: var(--wine); min-width: 6.5em }
.z-contact a { font: 700 calc(var(--fs) * 1.35)/1.2 var(--f-body); color: var(--red); text-decoration: none; overflow-wrap: anywhere }
.z-contact a:hover { text-decoration: underline wavy var(--pink) 2px; text-underline-offset: 5px }
.z-contact .copy { font: 700 calc(var(--fs) * .8)/1 var(--f-body); color: var(--ink); background: var(--pink); border: 0; padding: 6px 9px; cursor: pointer }
.z-num { position: absolute; bottom: 2.6%; left: 50%; transform: translateX(-50%); font: 400 calc(var(--fs) * .72) var(--f-mono); color: rgba(20, 16, 16, .5) }
.z-deco { position: absolute; z-index: 0; pointer-events: none; opacity: .85; -webkit-mask-image: var(--m-body); mask-image: var(--m-body); -webkit-mask-size: 512px; mask-size: 512px }
.z-deco.faint { opacity: .32 }   /* the light scatter: barely-there print */
.z-next.center { left: 50%; top: 50%; transform: translate(-50%, -50%) }
.z-next.corner { right: 6%; bottom: 5%; z-index: 7 }
.z-fill { position: absolute; left: 0; right: 0 }

/* loose pictures: dragged smoothly; on hover they tilt in 3D toward the pointer, with a glare and a shadow that move */
.z-scatter { position: absolute; inset: 0; z-index: 1 }
.z-ph { position: absolute; left: 0; top: 0; display: block; border: 0; padding: 0; background: none; cursor: grab; touch-action: none; --rx: 0deg; --ry: 0deg; --shx: 0px; --shy: 2px; --go: 0;
  box-shadow: var(--shx) var(--shy) calc(5px + 16px * var(--go)) rgba(40, 20, 10, calc(.3 + .2 * var(--go)));
  transition: transform .32s cubic-bezier(.3, 1.35, .5, 1), box-shadow .2s }
.z-ph img { display: block; max-width: none; object-fit: cover }   /* a size out of date in dims.json crops, never stretches */
.z-ph.tilt { transition: transform .12s ease-out, box-shadow .12s }
.z-ph.held { cursor: grabbing; transition: transform .07s linear; box-shadow: 0 14px 26px rgba(40, 20, 10, .38) }
.z-ph::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--go, 0); transition: opacity .2s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 60%) }
/* the focus outline shows only while the keyboard is in use (html.kbd, set by main.js): opening a zine puts the focus
   on its X, which drew the outline on phones at every opening */
html.kbd .z-ph:focus-visible, html.kbd .ear:focus-visible, html.kbd .stk:focus-visible { outline: 3px dashed var(--red); outline-offset: 3px }
/* a video in the zine: its still with a printed ▶ sticker stuck on a corner (without a still, a plain ink block).
   It plays in the full view */
.z-play { position: absolute; left: -12px; bottom: -12px; line-height: 0; pointer-events: none; transform: rotate(-8deg); z-index: 1 }
.z-play canvas { display: block }
.z-still { display: block; background: var(--wine) }

/* dog ears: a folded page corner drawn on a canvas (drawEar), anchored to its corner; the button is only the hit area.
   br = next page, bl = previous page, tr = jump to the end, tl = back to the start */
.ear { position: absolute; width: var(--hit); height: var(--hit); border: 0; padding: 0; background: none; cursor: pointer; z-index: 8 }
.ear.br { right: 0; bottom: 0 } .ear.bl { left: 0; bottom: 0 } .ear.tr { right: 0; top: 0 } .ear.tl { left: 0; top: 0 }
.ear canvas { position: absolute; pointer-events: none }
.ear.br canvas { right: 0; bottom: 0 } .ear.bl canvas { left: 0; bottom: 0 } .ear.tr canvas { right: 0; top: 0 } .ear.tl canvas { left: 0; top: 0 }
.ear-lbl { position: absolute; white-space: nowrap; font: 700 calc(var(--fs) * .85)/1 var(--f-body); color: var(--red); transform: rotate(-3deg) }
.ear.br .ear-lbl { right: calc(100% + 2px); bottom: 7px } .ear.bl .ear-lbl { left: calc(100% + 2px); bottom: 7px }
.ear.tr .ear-lbl { right: calc(100% + 2px); top: 9px } .ear.tl .ear-lbl { left: calc(100% + 2px); top: 9px }

/* printed stickers on the zine (X, arrows, "ver …"): canvas, 12fps jitter on .j, wiggle on hover, hop on click */
.stk { position: absolute; border: 0; padding: 0; background: none; cursor: pointer; z-index: 6; line-height: 0 }
.stk .j { display: block }
.stk canvas { display: block }
.stk:hover canvas, .stk:focus-visible canvas { animation: wig var(--wig-ms) steps(1, end) infinite }
.stk.hop canvas { animation: hop .33s steps(1, end) }
.z-close { left: 50%; top: -38px; margin-left: -60px }   /* stuck over the binding, leaving the top corners to the jump ears */
.cal .z-close { top: -60px }   /* phones: top middle, mostly above the page so it stays off the title */

/* full view: one picture or video whole, sticker arrows, X */
#lb { position: absolute; inset: 0; z-index: 20; background: rgba(20, 14, 12, .88); display: grid; place-items: center }
.lb-fig { margin: 0; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); background: var(--ink) }
.lb-fig.pop { animation: pop .25s steps(1, end) }
@keyframes pop { 0% { transform: scale(.86) rotate(-2deg) } 50% { transform: scale(1.02) rotate(.6deg) } 100% { transform: none } }
#lb { animation: fadeIn .2s ease-out both }
#lb.out { animation: fadeOut .26s ease-in both; pointer-events: none }
#lb.out .lb-fig { animation: popOut .26s steps(1, end) both }
@keyframes popOut { 0% { transform: none } 35% { transform: scale(1.02) rotate(.6deg) } 70% { transform: scale(.86) rotate(-2deg) } 100% { transform: scale(.86) rotate(-2deg); opacity: 0 } }
.lb-fig img, .lb-fig video { display: block; width: 100%; height: 100% }
.lb-fig img { object-fit: contain }   /* the full view shows the whole picture even if its size in dims.json is out of date */
.lb-fig iframe { display: block; width: 100%; height: 100%; border: 0 }
.lb-cap { position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); font: 400 12px var(--f-mono); color: var(--paper); white-space: nowrap }
.lb-prev { left: 18px; top: 50% } .lb-next { right: 18px; top: 50% }
.lb-x { right: 18px; top: 14px }
@media (max-width: 639px) { .lb-prev, .lb-next { top: auto; bottom: 46px } }
@media (prefers-reduced-motion: reduce) { #zine.in, .lb-fig.pop, .stk canvas, #modal .backdrop, #lb { animation: none !important } }
