/* =========================================================
   Yoann Renat — Portfolio 3D (bureau + carnet)
   ========================================================= */
:root {
    --bg: #050505;
    --text: #f2f0eb;
    --muted: rgba(242, 240, 235, .55);
    --amber: #ff7a1a;
    --ff: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --fm: 'Geist Mono', ui-monospace, Menlo, monospace;
    --fs: 'Instrument Serif', Georgia, serif;
    --ease: cubic-bezier(.16, 1, .3, 1);
    --pad: clamp(16px, 3vw, 36px);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--ff); overflow: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

#desk { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#desk.hover { cursor: pointer; }
.vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 55%, transparent 45%, rgba(0, 0, 0, .7) 100%); }

/* ---------- Loader ---------- */
.loader { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; transition: opacity .8s var(--ease), visibility .8s; }
.loader.done { opacity: 0; visibility: hidden; }
.loader-name { font-family: var(--fs); font-style: italic; font-size: clamp(2rem, 5vw, 3.2rem); color: #ffb36b; letter-spacing: -.02em; }
.loader-bar { width: 180px; height: 2px; background: rgba(255, 255, 255, .1); border-radius: 2px; overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--amber); transition: width .3s; }
.loader-txt { font-family: var(--fm); font-size: 11px; color: var(--muted); }

/* ---------- Top ---------- */
.ui-top { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: var(--pad); padding-top: max(var(--pad), env(safe-area-inset-top)); pointer-events: none; }
.ui-top > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; letter-spacing: -.02em; }
.brand-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--text); box-shadow: 3px 0 0 -1px var(--amber); }
.ui-top-r { display: flex; align-items: center; gap: 18px; }
.ghost-link { font-size: 13px; color: var(--muted); transition: color .25s; }
.ghost-link:hover { color: var(--text); }
.pill { font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 8px; background: var(--text); color: #0a0a0a; transition: background .25s, transform .25s var(--ease); }
.pill:hover { background: #fff; transform: translateY(-1px); }

/* ---------- Intro ---------- */
.intro { position: fixed; z-index: 5; left: var(--pad); top: calc(var(--pad) + 64px); max-width: 360px; pointer-events: none; transition: opacity .8s var(--ease), transform .8s var(--ease); }
.intro.hidden { opacity: 0; transform: translateY(-10px); }
.intro-title { font-size: clamp(1.6rem, 2.6vw, 2.4rem); font-weight: 600; letter-spacing: -.04em; line-height: 1.05; }
.intro-title span { color: var(--amber); }
.intro-sub { margin-top: 10px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

.hint { position: fixed; z-index: 5; left: 50%; bottom: calc(var(--pad) + 76px); transform: translateX(-50%); font-family: var(--fm); font-size: 12px; color: var(--muted); pointer-events: none; animation: bob 2s ease-in-out infinite; transition: opacity .5s; }
.hint.hidden { opacity: 0; animation: none; }
@keyframes bob { 50% { transform: translate(-50%, 5px); } }

/* ---------- Bottom ---------- */
.ui-bottom { position: fixed; z-index: 10; left: 50%; bottom: max(var(--pad), env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: rgba(18, 18, 18, .72); border: 1px solid rgba(255, 255, 255, .08); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); max-width: calc(100vw - 2 * var(--pad)); }
.nav-btn { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; background: rgba(255, 255, 255, .06); transition: background .2s, opacity .2s; flex: none; }
.nav-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.nav-btn:disabled { opacity: .3; cursor: default; }
.pager { display: flex; flex-direction: column; align-items: center; min-width: 150px; padding: 0 6px; }
.pager-num { font-family: var(--fm); font-size: 10.5px; color: var(--muted); }
.pager-label { font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.actions { display: flex; gap: 6px; }
.actions:empty { display: none; }
.actions a { font-size: 12.5px; font-weight: 500; padding: 10px 12px; border-radius: 10px; background: var(--amber); color: #140a02; white-space: nowrap; transition: background .2s; }
.actions a.alt { background: rgba(255, 255, 255, .08); color: var(--text); }
.actions a:hover { background: #ffb36b; color: #140a02; }

.noscript { position: fixed; inset: auto 16px 16px; z-index: 60; padding: 14px; background: #111; border-radius: 10px; }
.noscript a { color: var(--amber); }

@media (max-width: 700px) {
    .ghost-link { display: none; }
    .intro { top: calc(var(--pad) + 52px); max-width: 280px; }
    .pager { min-width: 0; flex: 1; }
    .pager-label { font-size: 12.5px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
    .ui-bottom { flex-wrap: wrap; justify-content: center; width: calc(100vw - 2 * var(--pad)); }
    .actions { width: 100%; justify-content: center; flex-wrap: wrap; }
    .hint { bottom: calc(var(--pad) + 120px); }
}
@media (prefers-reduced-motion: reduce) {
    .hint { animation: none; }
}
