/* unmpped — portfolio
   Base rules are the static fallback (no WebGL): black page, all content readable.
   html.gl switches to the scroll-driven layout: fixed canvas + fixed panels. */

:root {
  --ink: #e8e8ea;
  --dim: #7b7d86;
  --acc: #3d7bff;
  --display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --text: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { background: #000; color: var(--ink); font: 400 16px/1.55 var(--text); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; background: linear-gradient(#000 55%, #08080a); overflow-x: hidden; }
a { color: inherit; text-decoration: none; transition: color .25s; }
a:hover { color: var(--acc); }
:focus-visible { outline: 1px solid var(--acc); outline-offset: 5px; border-radius: 2px; }
ul { list-style: none; padding: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.mono { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
html.locked, html.locked body { overflow: hidden; }

/* ── Chrome of the page: brand, GitHub, progress, loader, cursor ── */
.top { position: fixed; z-index: 20; inset: 0 0 auto 0; display: flex; justify-content: space-between; align-items: center; padding: 22px 28px; pointer-events: none; }
.top a { pointer-events: auto; }
.brand { font: 500 13px var(--display); letter-spacing: .04em; }
.gh { display: inline-flex; align-items: center; gap: 9px; font: 500 11px var(--mono); letter-spacing: .12em; color: var(--acc); }
.gh:hover { color: var(--ink); }

.progress { position: fixed; z-index: 20; right: 27px; top: 50%; width: 15px; height: 36vh; transform: translateY(-50%); }
.progress .bar { position: absolute; left: 7px; top: 0; width: 1px; height: 100%; background: rgba(255, 255, 255, .13); }
.progress .bar i { position: absolute; inset: 0; background: var(--acc); transform-origin: top; transform: scaleY(0); }
.progress .mark { position: absolute; left: 0; width: 15px; height: 15px; margin-top: -7px; }
.progress .mark::after { content: ''; position: absolute; left: 3px; top: 7px; width: 9px; height: 1px; background: var(--dim); transition: background .3s, transform .3s; }
.progress .mark.past::after { background: var(--acc); }
.progress .mark:hover::after, .progress .mark:focus-visible::after { background: var(--acc); transform: scaleX(1.7); }

#loader { position: fixed; z-index: 30; left: 50%; top: calc(50% - 12vh); transform: translateX(-50%); font: 400 11px var(--mono); letter-spacing: .22em; color: var(--dim); pointer-events: none; }

.cursor { display: none; }
html.has-cursor, html.has-cursor * { cursor: none !important; }
html.has-cursor .cursor { display: block; }
.cursor i { position: fixed; z-index: 100; left: 0; top: 0; border-radius: 50%; pointer-events: none; will-change: transform; }
.cursor .dot { width: 5px; height: 5px; margin: -2.5px; background: #fff; mix-blend-mode: difference; }
.cursor .ring { width: 34px; height: 34px; margin: -17px; border: 1px solid rgba(232, 232, 234, .45); transition: width .3s, height .3s, margin .3s, border-color .3s; }
.cursor.is-link .ring { width: 62px; height: 62px; margin: -31px; border-color: var(--acc); }

/* ── Content (static fallback layout) ── */
#gl { display: none; }
section { padding: 12vh 8vw; max-width: 68rem; }
section:empty { display: none; }
h1 { font: 800 clamp(40px, 11vw, 150px)/1 var(--display); letter-spacing: -.02em; }
.role { margin-top: 1.4em; font: 500 clamp(11px, 1.05vw, 15px) var(--text); letter-spacing: .3em; }
.hint { display: none; }
.eyebrow { font: 400 11px var(--mono); letter-spacing: .22em; color: var(--dim); margin-bottom: 2.2em; }
.line { font-size: clamp(17px, 1.55vw, 24px); line-height: 1.42; margin-bottom: .85em; max-width: 30rem; }

.groups { display: flex; flex-wrap: wrap; gap: 28px 56px; }
.group h3 { font: 400 11px var(--mono); letter-spacing: .16em; color: var(--dim); margin-bottom: 1em; }
.group li { font: 500 12px/2 var(--mono); }

.project { margin-bottom: 9vh; }
.num { display: block; font: 800 clamp(84px, 12vw, 190px)/.82 var(--display); color: transparent; -webkit-text-stroke: 1px rgba(232, 232, 234, .17); margin: 0 0 .16em -.04em; }
.project h2 { font: 500 clamp(21px, 2.2vw, 36px)/1.15 var(--display); margin-bottom: .6em; }
.project p { color: var(--dim); max-width: 26rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 1.5em 0 1.9em; }
.tags li { font: 400 10px var(--mono); letter-spacing: .1em; padding: 5px 9px; border: 1px solid rgba(232, 232, 234, .16); border-radius: 99px; color: var(--dim); }
.view { display: inline-flex; gap: 12px; font: 500 12px var(--mono); letter-spacing: .12em; color: var(--acc); }
.view:hover { color: var(--ink); }
.arrow { display: inline-block; animation: nudge 1.7s ease-in-out infinite; }
.view:hover .arrow { animation-duration: .7s; }
@keyframes nudge { 50% { transform: translateX(7px); } }

.shot { margin: 0 0 8vh; }
.shot img { display: block; max-width: 100%; height: auto; border: 1px solid #17171b; border-radius: 4px; }
.shot figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-top: 14px; }
.shot b { font: 500 17px var(--display); }
.shot figcaption span { font: 400 11px var(--mono); letter-spacing: .08em; color: var(--dim); }

.final-link .label { display: inline-flex; align-items: center; gap: 11px; font: 500 13px var(--mono); letter-spacing: .1em; color: var(--acc); white-space: nowrap; transition: color .25s; }
.final-link:hover .label { color: var(--ink); }
.foot { display: flex; justify-content: space-between; gap: 20px; margin-top: 12vh; font: 400 10px var(--mono); letter-spacing: .16em; color: var(--dim); }
.totop { letter-spacing: .16em; transition: color .25s; }
.totop:hover { color: var(--acc); }
html:not(.gl) #loader, html:not(.gl) .progress, html:not(.gl) .totop { display: none; }

/* ── WebGL journey layout ── */
html.gl #gl { display: block; position: fixed; inset: 0; width: 100%; height: 100%; }
html.gl #journey section { display: block; height: calc(var(--h) * 100vh); padding: 0; max-width: none; }
html.gl .panel { position: fixed; z-index: 10; inset: 0; display: flex; align-items: center; padding: 0 clamp(24px, 8vw, 130px); opacity: 0; pointer-events: none; margin: 0; }
html.gl .panel.on a, html.gl .panel.on button { pointer-events: auto; }

html.gl .hero-panel { opacity: 1; justify-content: center; }
html.gl .hero-panel .in { opacity: 0; transform: translateY(12px); }
html.gl .role { position: absolute; top: calc(50% + 15vh); margin: 0; text-align: center; white-space: nowrap; }
html.gl .hint { display: block; position: absolute; bottom: 30px; font-size: 10px; letter-spacing: .3em; color: var(--dim); }

html.gl .skills-panel { align-items: flex-end; padding-bottom: 8vh; }
html.gl .skills-panel .eyebrow { display: none; }
html.gl .skills-panel .groups { gap: 26px; }
html.gl .skills-panel .group h3 { margin: 0; }
html.gl .skills-panel li { position: fixed; left: 0; top: 0; white-space: nowrap; line-height: 1; opacity: 0; will-change: transform, opacity; text-shadow: 0 0 12px #000; }

html.gl .project { justify-content: flex-end; }
html.gl .project .card { width: min(27rem, 36vw); }

html.gl .shot { margin: 0; }
html.gl .gl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html.gl .shot figcaption { text-shadow: 0 0 10px #000, 0 0 3px #000; position: fixed; z-index: 10; inset: auto 0 6.5vh 0; justify-content: center; margin: 0; padding: 0 24px; opacity: 0; pointer-events: none; }

html.gl .final-panel { align-items: flex-end; }
html.gl .final-link { position: fixed; display: block; left: 20vw; top: 35vh; width: 60vw; height: 20vh; }
html.gl .final-link .label { position: absolute; top: calc(100% + 20px); left: 50%; transform: translateX(-50%); }
html.gl .foot { position: fixed; inset: auto 28px 22px 28px; margin: 0; }

/* ── Mobile / portrait: matter above, text below ── */
@media (max-aspect-ratio: 23/20) {
  .top { padding: 18px 20px; }
  .progress { right: 12px; height: 30vh; }
  html.gl .panel { align-items: flex-end; justify-content: center; padding: 0 22px 9vh; }
  html.gl .hero-panel { align-items: center; padding-bottom: 0; }
  html.gl .role { top: calc(50% + 9vh); font-size: 10px; letter-spacing: .2em; }
  html.gl .project .card, html.gl .about-panel .col { width: 100%; }
  html.gl .skills-panel li { font-size: 10px; }
  .num { font-size: 72px; }
  .line { font-size: 16px; }
  html.gl .foot { inset: auto 20px 16px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .arrow { animation: none; }
  html.gl #gl { transition: opacity .22s linear; }
}

/* Chrome lettering for the small HTML texts: a tiling studio-reflection gradient clipped to the glyphs.
   --sheen is driven by time, scroll and pointer so the reflections slide like on the 3D matter.
   Dark bands stop at mid grey so small text stays readable on black. */
.chrome {
  background: repeating-linear-gradient(100deg, #fff 0, #e6eaf0 12px, #a3a9b4 27px, #fff 39px, #c4cad4 52px, #969ca8 68px, #f3f5f9 80px, #fff 90px);
  background-position: var(--sheen, 0px) 0;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  transition: filter .25s;
}
.chrome-blue { background-image: repeating-linear-gradient(100deg, #cfe0ff 0, #6d9bff 12px, #3d7bff 27px, #a9c6ff 39px, #4f86ff 52px, #2f66e6 68px, #7fa8ff 80px, #cfe0ff 90px); }
a.chrome:hover, .gh:hover .chrome { filter: brightness(1.35); }

/* Back to top: the visible control is the chrome chevron drawn in the scene; this is its (invisible) real button. */
html.gl .totop { position: fixed; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; }
