:root {
  --bg: #000;
  --text: #f5efe7;
  --muted: #a39b91;
  --accent: #ff9a4d;
  --glass: rgba(16, 12, 9, .62);
  --line: rgba(245, 239, 231, .14);
  --paper: #f4ede3;
  --ink: #1b1612;
  --head: "Anton", Impact, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: var(--body); }
body { overflow-x: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }

/* ── loader ── */
#loader {
  position: fixed; inset: 0; z-index: 50; background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  transition: opacity .7s ease, visibility .7s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-name { font-family: var(--head); font-size: clamp(28px, 5vw, 56px); letter-spacing: .04em; text-transform: uppercase; }
.loader-bar { width: min(260px, 60vw); height: 2px; background: var(--line); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.loader-pct { font-size: 12px; color: var(--muted); letter-spacing: .2em; }

/* ── film stage ── */
#stage {
  position: fixed; left: 0; top: 0; z-index: 0; will-change: transform;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
  mask-composite: intersect;
}
#film { display: block; width: 100%; height: 100%; object-fit: cover; background: #000; }
#frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
#frameRect { fill: none; stroke: var(--accent); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 8px rgba(255,154,77,.55)); }

/* ── top bar ── */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px clamp(16px, 4vw, 48px);
  background: linear-gradient(to bottom, rgba(0,0,0,.75), transparent);
}
.brand { font-family: var(--head); font-size: 18px; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; white-space: nowrap; }
nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
nav button { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-radius: 99px; transition: color .25s, background .25s; }
nav button:hover { color: var(--text); }
nav button.on { color: var(--text); background: rgba(255,154,77,.14); }
#progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: transparent; }
#progress i { display: block; height: 100%; width: 0; background: var(--accent); }

/* ── panels ── */
.panel { position: fixed; z-index: 10; opacity: 0; visibility: hidden; pointer-events: none; }
.panel.show { visibility: visible; pointer-events: auto; }
.glass { background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 22px; padding: clamp(22px, 2.6vw, 36px); }
.eyebrow { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.eyebrow.dark { color: #b35a17; }
h2 { font-family: var(--head); font-weight: 400; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.05; letter-spacing: .01em; margin-bottom: 14px; }
.body { color: #d8d0c6; font-size: 16px; line-height: 1.65; }
.accent { color: var(--accent); }

/* intro */
#s-intro { left: clamp(20px, 7vw, 120px); top: 50%; transform: translateY(-50%); max-width: 46vw; }
.hi { font-size: clamp(16px, 1.6vw, 22px); color: var(--muted); margin-bottom: 6px; }
#s-intro h1 { font-family: var(--head); font-weight: 400; font-size: clamp(56px, 7.2vw, 124px); line-height: .9; text-transform: uppercase; letter-spacing: .01em; }
#s-intro h1 span { display: block; }
.role { margin-top: 20px; font-size: clamp(15px, 1.4vw, 20px); color: var(--text); }
.status { margin-top: 12px; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #5fd38a; box-shadow: 0 0 0 0 rgba(95,211,138,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(95,211,138,0); } 100% { box-shadow: 0 0 0 0 rgba(95,211,138,0); } }

/* about */
#s-about { left: clamp(20px, 6vw, 100px); top: 50%; transform: translateY(-50%); width: min(500px, 40vw); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.stats b { display: block; font-family: var(--head); font-weight: 400; font-size: clamp(28px, 2.6vw, 38px); color: var(--accent); }
.stats span { font-size: 12px; color: var(--muted); letter-spacing: .04em; }

/* work */
#s-work { right: clamp(20px, 4vw, 70px); top: 50%; transform: translateY(-50%); width: min(420px, 34vw); perspective: 1200px; }
.cards { display: flex; flex-direction: column; gap: 14px; }
.card { display: flex; gap: 16px; align-items: flex-start; text-decoration: none; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; opacity: 0; transform-origin: left center; will-change: transform, opacity; transition: border-color .25s; }
.card:hover { border-color: rgba(255,154,77,.55); }
.card h4 { font-size: 18px; font-weight: 600; margin-bottom: 4px; display: flex; justify-content: space-between; gap: 12px; }
.card .tech { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.card p { font-size: 14px; color: #cfc7bd; line-height: 1.5; }

.card .num { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--head); font-size: 16px; color: var(--accent); border: 1px solid rgba(255,154,77,.45); }
.card.done { border-color: rgba(95,211,138,.45); }
.card.done .num { color: #5fd38a; border-color: rgba(95,211,138,.6); background: rgba(95,211,138,.1); font-family: var(--body); }

/* skills */
#s-skills { right: clamp(20px, 5vw, 90px); top: 16vh; width: min(520px, 42vw); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { padding: 10px 16px; border-radius: 99px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); font-size: 14px; opacity: 0; will-change: transform, opacity, filter; }

/* résumé */
#s-resume { right: clamp(20px, 6vw, 110px); top: 12vh; width: min(440px, 36vw); }
.paper { background: var(--paper); color: var(--ink); border-radius: 18px; padding: 28px 30px; box-shadow: 0 30px 80px rgba(0,0,0,.6); will-change: transform; }
.paper h3 { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: #8a7f73; margin: 18px 0 8px; }
.paper .item { margin-bottom: 10px; }
.paper .item b { display: block; font-size: 16px; }
.paper .item span { font-size: 14px; color: #5e554c; }
.btn { display: inline-block; margin-top: 18px; padding: 12px 20px; border-radius: 99px; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600; font-size: 14px; }
.btn[hidden] { display: none; }

.paper .inv-title { font-family: var(--head); font-weight: 400; font-size: 30px; line-height: 1.05; color: var(--ink); margin: 0 0 6px; letter-spacing: .01em; text-transform: none; }
.inv-note { font-size: 14px; color: #5e554c; line-height: 1.5; margin-bottom: 16px; }
.invoice { position: relative; background: #fff; border: 1px solid #e3d9cc; border-radius: 12px; padding: 16px 18px; }
.inv-head { display: flex; justify-content: space-between; font-size: 12px; color: #8a7f73; margin-bottom: 12px; letter-spacing: .04em; }
.inv-auto { color: #b35a17; font-weight: 600; }
.inv-line { display: flex; justify-content: space-between; font-size: 14px; padding: 7px 0; border-bottom: 1px dashed #e3d9cc; }
.inv-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px; font-size: 14px; }
.inv-total b { font-size: 22px; }
.inv-method { margin-top: 8px; font-size: 12px; color: #5e554c; }
.stamp { position: absolute; left: 40%; bottom: 22px; padding: 6px 14px; border: 3px solid #2f9e5b; color: #2f9e5b; border-radius: 8px; font-family: var(--head); font-size: 26px; letter-spacing: .12em; text-transform: uppercase; opacity: 0; pointer-events: none; background: rgba(255,255,255,.6); }

/* contact */
#s-contact { right: clamp(20px, 5vw, 90px); top: 50%; transform: translateY(-50%); width: min(480px, 40vw); background: rgba(8,6,4,.72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.price { margin: 18px 0 18px; padding: 14px 16px; border-radius: 14px; background: rgba(255,154,77,.1); border: 1px solid rgba(255,154,77,.3); }
.price b { display: block; font-size: 17px; color: var(--accent); margin-bottom: 4px; }
.price span { font-size: 13px; color: var(--muted); line-height: 1.45; }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.cta { padding: 13px 20px; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 14px; transition: transform .2s, background .25s, border-color .25s; }
.cta:hover { transform: translateY(-1px); border-color: var(--accent); }
.cta.primary { background: var(--accent); color: #1a0f06; border-color: var(--accent); }
.cta.primary:hover { background: #ffb173; }
.mail { display: inline-block; font-size: clamp(18px, 1.8vw, 24px); color: var(--accent); text-decoration: none; margin: 4px 0 18px; border-bottom: 1px solid rgba(255,154,77,.4); }
.links { display: flex; flex-wrap: wrap; gap: 10px; }
.links a { padding: 9px 16px; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; font-size: 14px; transition: border-color .25s, background .25s; }
.links a:hover { border-color: var(--accent); background: rgba(255,154,77,.1); }

/* hint */
#hint { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 15; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); transition: opacity .4s; }
#hint span { display: inline-block; animation: bob 1.6s ease-in-out infinite; color: var(--accent); }
@keyframes bob { 50% { transform: translateY(5px); } }

/* focus styles */
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ── mobile ── */
@media (max-width: 760px) {
  nav { display: none; }
  #topbar { padding: 14px 16px; }
  .panel { left: 16px !important; right: 16px !important; top: auto !important; bottom: 20px; transform: none !important; width: auto !important; max-width: none; }
  .panel::before { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 62vh; z-index: -1; background: linear-gradient(to top, rgba(0,0,0,.92) 45%, transparent); pointer-events: none; }
  .glass::before { display: none; }
  #s-intro { max-width: none; }
  #s-intro h1 { font-size: 52px; }
  .inv-note, .card p, #finText, .links { display: none; }
  .inv-title { font-size: 24px; }
  .price { margin: 10px 0 14px; }
  .ctas { margin-bottom: 0; }
  #s-intro { padding-bottom: 8px; }
  h2 { font-size: 30px; }
  .body { font-size: 15px; }
  .stats { margin-top: 16px; padding-top: 14px; }
  #s-work { perspective: none; }
  .card { padding: 14px 16px; }
  .paper { padding: 22px; }
  .chip { font-size: 13px; padding: 8px 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .dot, #hint span { animation: none; }
}
