@font-face { font-family: "Space Mono"; src: url("fonts/space-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("fonts/space-mono-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root { --bg: #000; --fg: #f2f2f2; --dim: #8a8a8a; --sans: "Helvetica Neue", Helvetica, Arial, sans-serif; --mono: "Space Mono", ui-monospace, Menlo, monospace; }
html.light { --bg: #f4f3ef; --fg: #0a0a0a; --dim: #6b6b6b; }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); scroll-behavior: smooth; transition: background .5s ease, color .5s ease; }
body { margin: 0; font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }

#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block; pointer-events: none; }
main, .top { position: relative; z-index: 1; }

/* loader: white card with a hashtag, like the reference */
.loader { position: fixed; inset: 0; z-index: 50; background: #f4f3ef; display: grid; place-items: center; transition: opacity .6s ease .1s, visibility 0s linear .7s; }
.loader span { font-family: var(--sans); font-weight: 900; font-size: clamp(2.4rem, 7vw, 5.5rem); letter-spacing: -.04em; color: #000; transform: scaleY(1.25); animation: jitter .18s steps(2) infinite; }
@keyframes jitter { 50% { transform: scaleY(1.25) translate(1px, -1px); } }
.loaded .loader { opacity: 0; visibility: hidden; }

/* header */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(16px, 3vw, 36px); mix-blend-mode: difference; color: #fff; }
.mark { font-family: var(--mono); font-weight: 700; text-decoration: none; font-size: .95rem; }
.top nav { display: flex; gap: clamp(14px, 3vw, 34px); }
.top nav a { font-family: var(--mono); font-size: .8rem; text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
.invert { width: 40px; height: 22px; border-radius: 99px; border: 1.5px solid #fff; background: none; padding: 0; cursor: pointer; position: relative; }
.invert i { position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .35s cubic-bezier(.5, 1.6, .4, 1); }
html.light .invert i { transform: translateX(18px); }

/* hero */
.hero { height: 100vh; min-height: 560px; display: grid; place-items: center; position: relative; }
.name, .contact-line { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; margin: 0; font-family: var(--sans); font-weight: 400; font-size: clamp(1.6rem, 4.4vw, 3.6rem); letter-spacing: -.035em; line-height: 1; white-space: nowrap; }
.name .gap, .contact-line .gap { display: inline-block; width: clamp(110px, 17vw, 240px); }
.hero-sub { position: absolute; left: clamp(16px, 3vw, 36px); bottom: clamp(20px, 4vh, 40px); margin: 0; font-family: var(--mono); font-size: .78rem; line-height: 1.5; color: var(--dim); }
.scroll-hint { position: absolute; right: clamp(16px, 3vw, 36px); bottom: clamp(20px, 4vh, 40px); margin: 0; font-family: var(--mono); font-size: .78rem; color: var(--dim); animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }

/* work: tall section, sticky info */
.work { height: 160vh; position: relative; }
.work-sticky { position: sticky; top: 0; height: 100vh; }
.work-info { position: absolute; left: clamp(16px, 3vw, 36px); bottom: clamp(20px, 5vh, 48px); max-width: 360px; font-family: var(--mono); }
.work-info .idx { font-size: .85rem; margin: 0 0 10px; color: var(--dim); }
.work-info .idx b { color: var(--fg); font-weight: 700; }
.work-info h2 { font-family: var(--sans); font-weight: 500; font-size: clamp(1.4rem, 2.6vw, 2.2rem); letter-spacing: -.03em; margin: 0 0 6px; line-height: 1.05; }
.work-info p { font-size: .8rem; line-height: 1.5; margin: 0 0 6px; }
.work-info .tags { color: var(--dim); }
.work-info.swap h2, .work-info.swap p { animation: glitch .45s steps(3); }
@keyframes glitch { 0% { opacity: 0; transform: translateX(-6px); clip-path: inset(0 0 60% 0); } 50% { opacity: 1; transform: translateX(4px); clip-path: inset(40% 0 0 0); } 100% { transform: none; clip-path: inset(0); } }
.work-hint { position: absolute; right: clamp(16px, 3vw, 36px); bottom: clamp(20px, 5vh, 48px); margin: 0; font-family: var(--mono); font-size: .75rem; color: var(--dim); }

/* about */
.about { min-height: 120vh; display: grid; align-items: center; justify-items: end; padding: 0 clamp(16px, 6vw, 110px); }
.about-text { max-width: 400px; font-family: var(--mono); font-size: .82rem; line-height: 1.65; }
.about-text h2 { font-family: var(--mono); font-weight: 400; font-size: .95rem; margin: 0 0 1.2em; letter-spacing: .02em; }
.about-text p { margin: 0 0 1.1em; }

/* contact */
.contact { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(26px, 5vh, 46px); position: relative; padding: 110px 16px 90px; }
.links { display: flex; align-items: center; gap: 14px; margin: 0; font-family: var(--mono); font-size: .8rem; position: relative; z-index: 6; }
.links svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; display: block; }
.links a { text-decoration: none; }
.links .mail-text:hover { text-decoration: underline; }
.foot { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; margin: 0; font-family: var(--mono); font-size: .7rem; color: var(--dim); }

.nojs { position: fixed; inset: 0; display: grid; place-items: center; font-family: var(--mono); background: #000; color: #fff; z-index: 99; margin: 0; }

@media (max-width: 640px) {
  .top nav { gap: 14px; }
  .work-info { right: 16px; max-width: none; }
  .work-hint { display: none; }
  .about { justify-items: start; align-items: end; padding-bottom: 12vh; }
  .about-text { max-width: 100%; }
}
html.calm { scroll-behavior: auto; }
html.calm .loader span, html.calm .scroll-hint { animation: none; }


.name > span:first-child, .contact-line > span:first-child { justify-self: end; }
.name > span:last-child, .contact-line > span:last-child { justify-self: start; }
.hero .name { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); }

/* letters that scatter */
.name .ch, .contact-line .ch { display: inline-block; will-change: transform; white-space: pre; }

/* custom cursor (mouse only) */
.cursor { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; mix-blend-mode: difference; color: #fff; display: none; }
.cursor i { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; transition: transform .25s cubic-bezier(.3, 1.6, .4, 1), opacity .2s; }
.cursor b { position: absolute; left: 14px; top: 10px; font: 700 .72rem var(--mono); letter-spacing: .04em; text-transform: lowercase; white-space: nowrap; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; }
.cursor.is-link i { transform: scale(3.2); }
.cursor.is-label i { transform: scale(2.2); }
.cursor.is-label b { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor { display: block; }
  html.loaded, html.loaded * { cursor: none !important; }
}
.work-hint { text-align: right; line-height: 1.6; }

/* site switcher next to the console */
.sites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.site-btn { font: 400 .75rem var(--mono); color: var(--fg); background: transparent; border: 1px solid color-mix(in srgb, var(--fg) 35%, transparent); border-radius: 99px; padding: 6px 12px; cursor: pointer; transition: background .2s, color .2s; }
.site-btn b { font-weight: 700; margin-right: 4px; }
.site-btn:hover { border-color: var(--fg); }
.site-btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.site-btn.soon { color: var(--dim); border-style: dashed; }
.site-btn.soon[aria-pressed="true"] { color: var(--bg); }
.work-hint { text-align: right; }
.work-hint p { margin: 0 0 3px; }
.work-hint b { color: var(--fg); font-weight: 700; }

/* BIT: pixel creature (bit.js) */
.bit { position: fixed; left: 0; top: 0; z-index: 25; width: 48px; height: 48px; cursor: pointer; will-change: transform; -webkit-tap-highlight-color: transparent; }
.bit-sprite { width: 48px; height: 48px; display: block; image-rendering: pixelated; image-rendering: crisp-edges; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--fg) 25%, transparent)); }
.bit:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.bit-fx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 24; pointer-events: none; }
.bit-ghost { position: fixed; left: 0; top: 0; z-index: 24; width: 48px; height: 48px; image-rendering: pixelated; pointer-events: none; opacity: 0; mix-blend-mode: screen; }
html.light .bit-ghost { mix-blend-mode: multiply; }
.bit-holo.on.glitch-in { animation: holo-in .32s steps(6) 1, holo-flicker 3s steps(1) .32s infinite; }
@keyframes holo-in { 0% { clip-path: inset(0 100% 0 0); filter: hue-rotate(90deg); } 30% { clip-path: inset(0 40% 60% 0); } 60% { clip-path: inset(30% 0 0 0); } 100% { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px)); filter: none; } }
.bit-holo { position: fixed; left: 0; top: 0; z-index: 26; max-width: min(420px, calc(100vw - 16px)); padding: 12px 14px; font: 400 .72rem/1.55 var(--mono); color: #bffcff; background: rgba(6, 16, 22, .82); border: 1px solid rgba(120, 240, 255, .55); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px)); box-shadow: 0 0 24px rgba(80, 220, 255, .25); text-shadow: 0 0 6px rgba(120, 240, 255, .7); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .18s, visibility 0s linear .18s; backdrop-filter: blur(3px); }
.bit-holo::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(120, 240, 255, .07) 0 1px, transparent 1px 3px); pointer-events: none; animation: holo-scan 2.4s linear infinite; }
.bit-holo.on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .18s, visibility 0s; animation: holo-flicker 3s steps(1) infinite; }
.bit-holo .h-row { white-space: pre-wrap; word-break: break-word; }
.bit-holo .h-p { color: #7fa9b3; } .bit-holo .h-t { color: #ff7ce5; } .bit-holo .h-a { color: #8ef9ff; } .bit-holo .h-v { color: #fff59a; } .bit-holo .h-x { color: #e9feff; } .bit-holo .h-c { color: #6dd3a8; }
@keyframes holo-scan { to { background-position: 0 30px; } }
@keyframes holo-flicker { 0%, 100% { filter: none; } 47% { filter: brightness(.8); } 48% { filter: none; } 91% { filter: brightness(.9); } }
.bit-phone { position: fixed; left: 0; top: 0; z-index: 24; width: 80px; height: 132px; image-rendering: pixelated; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .3s; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45)); }
.bit-phone.on { opacity: 1; pointer-events: auto; }
html.calm .bit-holo::before, html.calm .bit-holo.on { animation: none; }

/* keep corner text clear of the critter */
.scroll-hint { right: 84px; }
.work-hint { bottom: 86px; }

/* contact form (terminal) + receipt */
.gb { width: min(560px, 100%); display: grid; gap: 4px; font: 400 .82rem var(--mono); position: relative; z-index: 6; }
.gb-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid color-mix(in srgb, var(--fg) 35%, transparent); padding: 7px 0; }
.gb-row:focus-within { border-bottom-color: var(--fg); }
.gb label { white-space: nowrap; color: var(--dim); min-width: 88px; }
.gb input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--fg); font: inherit; caret-color: var(--fg); padding: 4px 0; }
.gb input::placeholder { color: color-mix(in srgb, var(--fg) 35%, transparent); }
.gb button { background: var(--fg); color: var(--bg); border: 0; font: 700 .74rem var(--mono); padding: 8px 14px; cursor: pointer; }
.gb button:disabled { opacity: .5; cursor: wait; }
.gb-hp { position: absolute; left: -9999px; }
.gb-status { margin: 6px 0 0; min-height: 1.2em; font-size: .74rem; color: var(--dim); }
.gb-status.ok { color: var(--fg); }
.gb-slot { width: 250px; position: relative; z-index: 5; }
.gb-slot:empty { display: none; }
@media (min-width: 1100px) { .gb-slot { position: absolute; left: calc(50% + 320px); top: 50%; transform: translateY(-50%); } }
.receipt { pointer-events: auto; cursor: pointer; position: relative; background: #f4f1e8; color: #151515; font: 400 .66rem/1.45 var(--mono); padding: 14px 14px 22px; transform-origin: 50% 0; clip-path: inset(0 0 100% 0); transform: rotate(-1.2deg); box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 8px) no-repeat, conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) bottom / 10px 8px repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - 8px) no-repeat, conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) bottom / 10px 8px repeat-x; }
.receipt::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(0, 0, 0, .1) .6px, transparent .8px); background-size: 3px 3px; pointer-events: none; }
.receipt.feed { animation: feed .95s steps(14) forwards; }
@keyframes feed { to { clip-path: inset(0 0 0 0); } }
.receipt.tear { animation: tear .45s ease-in forwards; clip-path: inset(0 0 0 0); }
@keyframes tear { to { transform: translateY(40px) rotate(8deg); opacity: 0; } }
.receipt p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.receipt .r-head { font-weight: 700; font-size: .82rem; letter-spacing: .08em; text-align: center; }
.receipt .r-sub { text-align: center; margin-bottom: 4px; }
.receipt .r-cut { color: #888; overflow: hidden; white-space: nowrap; }
.receipt .r-msg { font-weight: 700; font-size: .74rem; margin: 6px 0; }
.receipt .r-dim { color: #666; }
.receipt .r-code { display: flex; gap: 1px; height: 22px; margin-top: 8px; }
.receipt .r-code i { display: block; height: 100%; background: #151515; }
.site-btn.secret { border-color: #8ef9ff; color: #8ef9ff; text-shadow: 0 0 6px rgba(142, 249, 255, .7); box-shadow: 0 0 12px rgba(142, 249, 255, .25); animation: secret-pulse 2.4s ease-in-out infinite; }
.site-btn.secret[aria-pressed="true"] { background: #8ef9ff; color: #001014; text-shadow: none; }
@keyframes secret-pulse { 50% { box-shadow: 0 0 22px rgba(142, 249, 255, .5); } }
.egg-btn { background: none; border: 0; padding: 4px 6px; cursor: pointer; display: inline-flex; align-items: center; opacity: .75; transition: opacity .2s; }
.egg-btn canvas { width: 22px; height: 27.5px; image-rendering: pixelated; display: block; }
.egg-btn:hover { opacity: 1; }
.egg-btn:hover canvas { animation: egg-wobble .5s ease-in-out infinite; }
.egg-btn.crack canvas { animation: egg-crack .25s steps(3); }
@keyframes egg-wobble { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes egg-crack { 50% { transform: scale(1.25) translateY(-3px); } }
.flip-btn { margin-top: 8px; background: none; color: var(--fg); border: 1px solid color-mix(in srgb, var(--fg) 40%, transparent); border-radius: 99px; padding: 6px 12px; font: 400 .72rem var(--mono); cursor: pointer; pointer-events: auto; }
.flip-btn:hover { background: var(--fg); color: var(--bg); }

/* language switch: EN | FR with a sliding block */
.top { gap: 14px; }
.lang-switch { position: relative; display: inline-flex; align-items: center; margin-left: auto; margin-right: 12px; padding: 0; height: 22px; border: 1.5px solid #fff; border-radius: 99px; background: none; color: #fff; font: 700 .66rem var(--mono); cursor: pointer; overflow: hidden; }
.lang-switch span { position: relative; z-index: 1; width: 28px; text-align: center; transition: color .25s; }
.lang-switch i { position: absolute; top: 2px; bottom: 2px; left: 2px; width: 25px; border-radius: 99px; background: #fff; transition: transform .35s cubic-bezier(.5, 1.6, .4, 1); }
.lang-switch[data-on="fr"] i { transform: translateX(28px); }
.lang-switch[data-on="en"] span[data-l="en"], .lang-switch[data-on="fr"] span[data-l="fr"] { color: #000; }
.top nav { margin-left: auto; }
.lang-sweep { position: fixed; left: 0; right: 0; top: -20vh; height: 16vh; z-index: 40; pointer-events: none; mix-blend-mode: difference;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.9) 60%, transparent), radial-gradient(#fff 1px, transparent 1.3px) 0 0 / 4px 4px; animation: lang-sweep .8s cubic-bezier(.6, .1, .3, 1) forwards; }
@keyframes lang-sweep { to { transform: translateY(140vh); } }
html.calm .lang-sweep { display: none; }
.top nav a { white-space: nowrap; }
.lang-switch, .invert, .mark { flex-shrink: 0; }
@media (max-width: 440px) {
  .top { gap: 8px; padding: 14px 12px; }
  .top nav { gap: 11px; }
  .top nav a { font-size: .68rem; }
  .lang-switch { margin-right: 2px; }
  .lang-switch span { width: 24px; }
  .lang-switch i { width: 21px; }
  .lang-switch[data-on="fr"] i { transform: translateX(24px); }
}
