:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #090711;
  color: #f5efff;
  --muted: #beb2cf;
  --edge: #38294b;
  --accent: #d3b3ff;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a, button, canvas { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.wrap { width: min(100% - 72px, 1120px); margin-inline: auto; }
.skip { position: fixed; top: 8px; left: 8px; padding: 12px; background: var(--accent); color: #180e25; z-index: 8; transform: translateY(-160%); }
.skip:focus { transform: none; }

.top { position: relative; z-index: 3; border-bottom: 1px solid #d6bbff24; }
.home-page .top { position: absolute; inset: 0 0 auto; border: 0; }
.top-inner { min-height: 76px; display: flex; align-items: center; gap: 12px; }
.top-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; margin-left: auto; }
.back-link, .sound, .menu-toggle { min-height: 44px; display: inline-flex; align-items: center; font-size: .9rem; font-weight: 650; }
.back-link:hover { color: var(--accent); }
.sound { gap: 9px; padding: 8px 13px; border: 1px solid #cfaeff55; border-radius: 999px; background: #140c21d9; white-space: nowrap; }
.sound:hover, .sound[aria-pressed="true"] { border-color: #e2c6ff; }
.sound-bars { display: inline-flex; align-items: center; gap: 2px; height: 14px; color: var(--accent); }
.sound-bars i { width: 2px; height: 7px; background: currentColor; border-radius: 2px; }
.sound-bars i:nth-child(2) { height: 13px; animation-delay: -.3s; }
.sound-bars i:nth-child(3) { height: 10px; animation-delay: -.6s; }
.sound-bars i:nth-child(4) { height: 5px; animation-delay: -.45s; }
.sound[aria-pressed="true"] i { animation-name: pulse; animation-duration: .9s; animation-timing-function: ease-in-out; animation-iteration-count: infinite; animation-direction: alternate; }
.menu-toggle { gap: 9px; padding: 8px 14px; border: 1px solid #e6c6ff7c; border-radius: 999px; background: #e3c9ff; color: #231437; }
.menu-toggle:hover { background: #f0dbff; }
.menu-lines { width: 15px; height: 7px; border-block: 1px solid currentColor; }

body:has(dialog[open]) { overflow: hidden; }
dialog { color: #f5efff; border: 1px solid #d6afff64; background: #140d20; }
dialog::backdrop { background: #090610ad; backdrop-filter: blur(7px); }
.site-menu { position: fixed; inset: 12px 12px 12px auto; margin: 0; width: min(430px, 100% - 24px); max-width: none; max-height: none; padding: clamp(18px, 4vw, 32px); border-radius: 19px; background: radial-gradient(ellipse at 100% 0, #392451, transparent 62%), #140d20; box-shadow: 0 6px 65px #07040eb3; }
.site-menu[open] { animation: slide-menu .3s cubic-bezier(.21,.75,.3,1) both; }
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 30px; }
.menu-head h2 { font-size: 1.65rem; letter-spacing: -.035em; }
.menu-close { width: 44px; height: 44px; font-size: 1.55rem; line-height: 1; background: #211431; border: 1px solid #725289; border-radius: 50%; }
.menu-close:hover { border-color: var(--accent); }
.site-menu nav { display: grid; gap: 8px; }
.site-menu nav a { display: flex; align-items: center; min-height: 54px; padding: 8px 14px; border: 1px solid transparent; border-radius: 10px; font-size: 1.12rem; font-weight: 620; }
.site-menu nav a:hover, .site-menu nav a[aria-current="page"] { border-color: #ad7bd451; background: #ad7bd41a; color: #ebd5ff; }


.home-page .top-controls { width: 100%; justify-content: space-between; }
.home-audio { display: flex; align-items: center; gap: 9px; }
.home-audio .sound { width: 44px; padding: 0; justify-content: center; }
.home-audio input { width: clamp(55px, 9vw, 104px); margin: 0 0 0 3px; accent-color: #dac2ff; cursor: pointer; }
.track-info { display: grid; gap: 2px; min-width: 0; color: #f9f0ff; line-height: 1.15; text-shadow: 0 1px 5px #090711; }
.track-info strong { font-size: .88rem; font-weight: 720; }
.track-info span { font-size: .75rem; color: #d7c6e7; }
.home-audio:has(.sound[aria-pressed="true"]) .track-info span { color: #e8caff; }
.home-page .menu-toggle { background: #100b19d9; color: #eee5fa; border-color: #e6c6ff6e; }
.home-page .menu-toggle:hover { border-color: #e6c6ff; }

.entry { width: min(390px, 100% - 32px); max-width: none; padding: 24px; text-align: center; background: transparent; border: 0; }
.entry[open] { animation: appear .55s ease-out both; }
.entry::backdrop { background: #07050ce8; backdrop-filter: blur(12px); }
.entry-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.enter { min-height: 48px; padding: 10px 24px; border: 1px solid #e8d1ff80; border-radius: 999px; background: #e3c9ff; color: #22132f; font-weight: 750; transition: background .2s, box-shadow .2s; }
.enter:hover { background: #f3defe; box-shadow: 0 0 27px #b58ae36b; }
.quiet { min-height: 44px; padding: 8px 18px; border: 0; border-radius: 999px; background: transparent; color: #c8b7d9; font-size: .9rem; font-weight: 600; }
.quiet:hover { color: #fff3ff; }

.profile { min-height: 100svh; min-height: max(580px, 100svh); position: relative; isolation: isolate; overflow: hidden; display: grid; place-items: center; padding: 88px 18px 48px; background: #0e0a14; }
.profile-background, .profile-rain, .pointer-aura, .pointer-trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.profile-background { z-index: -4; object-fit: cover; object-position: 54% 54%; animation: drift 29s ease-in-out infinite alternate; }
.profile::before { content: ""; position: absolute; inset: 0; z-index: -3; pointer-events: none; background: linear-gradient(160deg, #0906108c, #130b1b1a 53%, #0906108c); }
.profile::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 50% 40%, transparent 36%, #0906115c 100%); }
.profile-rain { z-index: -2; background: repeating-linear-gradient(104deg, transparent 0 44px, #d5bdff40 44px 45px, transparent 45px 56px); background-size: 180px 200px; mask-image: radial-gradient(ellipse at 78% 58%, #000 0, transparent 63%); opacity: .21; animation: rain 1.65s linear infinite; }
.pointer-aura { z-index: -2; opacity: 0; background: radial-gradient(310px 310px at var(--pointer-x, 50%) var(--pointer-y, 50%), #b682ff41, transparent); transition: opacity .32s ease; }
.has-pointer .pointer-aura { opacity: 1; }
.pointer-trail { z-index: 2; }

.profile-inner { position: relative; width: min(526px, 100%); display: grid; gap: clamp(14px, 2.6vw, 24px); padding: clamp(18px, 4vw, 32px); border: 1px solid #e2c4ff61; border-radius: 19px; background: linear-gradient(132deg, #251836dc 0%, #100c18de 51%, #1b1127d9); backdrop-filter: blur(13px); box-shadow: 0 20px 82px #05020dd1, inset 0 1px #e6d3ff24; transform: perspective(1030px) rotateX(0) rotateY(0); transition: transform .24s cubic-bezier(.16,.76,.34,1); animation: reveal .6s ease both; }
.has-pointer .profile-inner { transform: perspective(1030px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); }
.home-page:has(.entry[open]) .profile-inner { animation: none; }
.profile h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(3rem, 11vw, 5.25rem); font-weight: 700; line-height: .98; letter-spacing: -.075em; text-align: center; text-shadow: 0 0 28px #aa74e44d; }
.profile h1 span { color: #dec8f8; }
.profile h1:focus { outline: none; }
.profile-work { justify-self: center; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 19px; border: 1px solid #b992e57a; border-radius: 999px; background: #312145a8; font-weight: 650; }
.profile-work:hover { border-color: var(--accent); background: #482d62; }
.profile-contacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 12px; border-top: 1px solid #b88cd63c; }
.wing-link { display: grid; justify-items: center; align-content: center; gap: 6px; min-width: 0; padding: 7px 3px 9px; border: 1px solid transparent; border-radius: 12px; color: #f5eaff; transition: background .2s, border-color .2s; }
.wing-link:hover, .wing-link:focus-visible { background: #ad7bd41a; border-color: #b48bdf57; }
.wing-link-art { display: flex; align-items: center; justify-content: center; gap: 3px; }
.wing { display: block; width: clamp(32px, 8.5vw, 57px); aspect-ratio: 64 / 54; height: auto; filter: drop-shadow(0 1px 5px #ad78e464); transition: transform .24s cubic-bezier(.15,.7,.25,1), filter .2s; }
.wing-left { transform: rotate(4deg); transform-origin: 87% 70%; }
.wing-right { transform: scaleX(-1) rotate(4deg); transform-origin: 50% 70%; }
.wing-emblem { width: clamp(22px, 5vw, 29px); height: auto; flex: 0 0 auto; color: #fbf3ff; }
.wing-link:hover .wing-left, .wing-link:focus-visible .wing-left { transform: rotate(14deg) translateX(-3px); }
.wing-link:hover .wing-right, .wing-link:focus-visible .wing-right { transform: scaleX(-1) rotate(14deg) translateX(-3px); }
.wing-link:hover .wing, .wing-link:focus-visible .wing { filter: drop-shadow(0 0 7px #c88dffbd); }
.wing-link-label { display: grid; gap: 3px; text-align: center; line-height: 1.15; }
.wing-link-label strong { color: #f8efff; font-size: .93rem; font-weight: 720; }
.wing-link-label span { color: #dac9e9; font-size: .81rem; overflow-wrap: anywhere; }
.profile-note { grid-column: 2; justify-self: center; padding: 5px 4px; color: #cbb9dd; font-size: .8rem; text-decoration: underline; text-underline-offset: .22em; }
.profile-note:hover { color: #f8efff; }

.audio-status { position: fixed; bottom: 16px; right: 16px; z-index: 5; padding: 9px 14px; border-radius: 10px; background: #1c1028; color: #f5efff; }
@keyframes appear { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes rain { to { background-position: -180px 200px; } }
@keyframes drift { from { transform: scale(1.01); } to { transform: scale(1.07) translateY(-1.3%); } }
@keyframes pulse { from { transform: scaleY(.55); } to { transform: scaleY(1.08); } }
@keyframes slide-menu { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: translateX(0); } }

.contacts-page, .works-page { background: radial-gradient(ellipse at 50% 0, #251535, transparent 68%), #090711; }
.section-title { grid-column: 1 / -1; font-size: clamp(2rem, 4vw, 3.45rem); letter-spacing: -.055em; line-height: 1; }
.works { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; gap: clamp(13px, 2.8vw, 24px); padding-block: clamp(34px, 5vw, 64px); }
.viewer { grid-column: 1; grid-row: 2; margin: 0; min-width: 0; overflow: hidden; scroll-margin-top: 20px; border: 1px solid #503865; border-radius: 13px; background: #191123; }
.stage { position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 1.45; min-height: 250px; background: radial-gradient(ellipse at 50% 48%, #473264, #29223e 44%, #171122 86%); }
.stage[data-model="pickaxe"] { background: radial-gradient(ellipse at 50% 48%, #44386c, #292743 44%, #191527 84%); }
.stage[data-model="kalash"] { background: radial-gradient(ellipse at 50% 48%, #4b344d, #302238 44%, #1c1524 84%); }
.stage::before { content: ""; position: absolute; z-index: -1; inset: 0; background-image: linear-gradient(#d5b9ff20 1px, transparent 1px), linear-gradient(90deg, #d5b9ff20 1px, transparent 1px); background-size: 34px 34px; background-position: center; mask-image: radial-gradient(ellipse, #000 28%, transparent 92%); }
.stage-poster, #model { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-poster { object-fit: contain; pointer-events: none; }
#model { display: block; cursor: grab; touch-action: pan-y; }
#model:active { cursor: grabbing; }
#model:focus-visible { outline: 2px solid var(--accent); outline-offset: -5px; }
.stage-message { position: absolute; z-index: 2; left: 16px; bottom: 14px; max-width: calc(100% - 88px); padding: 8px 10px; background: #1a1323; border-radius: 4px; font-size: .875rem; }
.tools { position: absolute; bottom: 12px; right: 12px; display: flex; flex-direction: column; gap: 4px; }
.tools button, .mode { background: #21172b; border: 1px solid #604b72; border-radius: 5px; }
.tools button { width: 42px; height: 42px; font-size: 1.2rem; line-height: 1; }
.tools button:hover, .mode:hover, .mode[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid #503865; }
.caption h2 { font-size: 1.05rem; }
.caption p { font-size: .875rem; line-height: 1.4; color: var(--muted); margin-top: 4px; }
.mode { min-height: 42px; padding: 7px 12px; }
.work-download { grid-column: 1; grid-row: 3; display: grid; gap: 10px; justify-items: start; }
.download-button { display: inline-flex; align-items: center; min-height: 44px; background: #e2c6ff; color: #281536; border-radius: 999px; padding: 8px 18px; font-size: .95rem; font-weight: 720; }
.download-button:hover { background: #f2dfff; }
.install-steps { margin: 0; padding: 0 17px 16px 38px; color: #d3c4e0; line-height: 1.6; font-size: .93rem; }
.install-steps li + li { margin-top: 8px; }
.install-steps a { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }
.cards { grid-column: 2; grid-row: 2 / span 2; display: grid; gap: 10px; }
.project { display: grid; grid-template-columns: minmax(80px, .56fr) minmax(0, 1fr); align-items: stretch; width: 100%; padding: 0; border: 1px solid var(--edge); border-radius: 9px; overflow: hidden; background: #191123; text-align: left; }
.project:hover, .project[aria-pressed="true"] { border-color: #b48bdc; }
.thumb { display: grid; place-items: center; overflow: hidden; min-height: 95px; background: radial-gradient(ellipse at center, #47325f, #1d152b); }
.thumb img { display: block; width: 100%; height: auto; transition: transform 180ms ease-out; }
.project:hover img { transform: scale(1.075); }
.card-info { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-height: 84px; padding: 9px 11px; }
.card-name, .card-type { display: block; }
.card-name { font-size: .98rem; font-weight: 720; line-height: 1.2; }
.card-type { color: var(--muted); margin-top: 4px; font-size: .8rem; }
.card-action { flex: 0 0 auto; color: var(--accent); font-size: .77rem; border: 1px solid #695280; padding: 4px 5px; border-radius: 4px; }
.contact-section { display: grid; gap: clamp(18px, 3vw, 30px); padding: clamp(36px, 7vw, 82px) 0; }
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: min(650px, 100%); }
.contact-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; padding: 17px 18px; border: 1px solid #5b4273; border-radius: 11px; background: #1c1229; }
.contact-card:target { scroll-margin-block: 18px; border-color: var(--accent); }
a.contact-card:hover { border-color: var(--accent); }
.contact-card span { font-size: .9rem; color: var(--muted); }
.contact-card strong, .contact-handle { font-size: 1.13rem; font-weight: 730; color: var(--accent); overflow-wrap: anywhere; }
.contact-handle:hover { text-decoration: underline; }
.copy-contact { min-height: 42px; margin-top: 4px; padding: 7px 10px; background: #2b1a3e; border: 1px solid #795994; border-radius: 6px; font-size: .875rem; }
.copy-contact:hover { border-color: var(--accent); }
.contact-status { color: var(--muted); }

.blockbench-files { width: min(650px, 100%); scroll-margin-top: 20px; border: 1px solid #5b4273; border-radius: 11px; background: #1c1229; }
.blockbench-files summary { min-height: 48px; padding: 13px 15px; color: #e8d7f8; cursor: pointer; }
.blockbench-files summary:hover { color: var(--accent); }
.blockbench-files ul { list-style: none; display: grid; gap: 5px; padding: 0 10px 10px; margin: 0; }
.blockbench-files a[download] { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 8px 10px; border-radius: 6px; }
.blockbench-files a[download]:hover { background: #cca3ff24; }
.file-extension { color: var(--accent); font-size: .8rem; }

@media (max-width: 740px) {
  .wrap { width: calc(100% - 36px); }
  .top-inner { min-height: 68px; }
  .profile { min-height: max(540px, 100svh); }
  .works { grid-template-columns: 1fr; }
  .viewer, .work-download, .cards { grid-column: 1; grid-row: auto; }
}
@media (max-width: 570px) {
  .home-audio { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 1px 6px; }
  .home-audio .sound { width: 40px; min-height: 40px; grid-row: span 2; }
  .home-audio input { width: 78px; height: 15px; margin: 0; }
  .track-info strong { font-size: .8rem; }
  .track-info span { font-size: .7rem; }
}
@media (max-width: 430px) {
  .profile { padding-inline: 12px; }
}
@media (max-width: 365px) {
  .wrap { width: calc(100% - 28px); }
  .sound, .menu-toggle { padding-inline: 8px; font-size: .8rem; }
  .top-inner, .top-controls { gap: 6px; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .has-pointer .profile-inner { transform: none; }
}

@media (any-pointer: fine) {
  html, dialog { cursor: url('/assets/cursor-violet.svg') 4 3, auto; }
  a[href], button, summary, input[type="range"] { cursor: url('/assets/cursor-link.svg') 4 3, pointer; }
}
