:root {
	--bg: #ffffff;
	--fg: #0a0a0a;
	--muted: #8a8a8a;
	--hair: rgba(10, 10, 10, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { background: var(--bg); color: var(--fg); }
body {
	font-family: "Fraunces", ui-serif, Georgia, serif;
	font-optical-sizing: auto;
	font-variation-settings: "SOFT" 50, "WONK" 0;
	font-size: 18px; line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
body::before {
	content: "";
	position: fixed; inset: 0;
	background:
		radial-gradient(circle at 50% 18%, rgba(10, 10, 10, 0.05), transparent 48%),
		linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.76) 40%, rgba(255, 255, 255, 0.96));
	opacity: 0;
	transform: scale(1.02);
	transform-origin: center;
	transition: opacity 1.05s cubic-bezier(.22,1,.36,1), transform 1.2s cubic-bezier(.22,1,.36,1);
	pointer-events: none;
	z-index: 40;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--fg); color: var(--bg); }
a:focus-visible, button:focus-visible {
	outline: 1px solid rgba(10, 10, 10, 0.45);
	outline-offset: 3px;
}
.modal a:focus-visible, .modal button:focus-visible { outline-color: rgba(255, 255, 255, 0.72); }

.mono, .meta, nav, .brand, .flap {
	font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
	font-size: 12px; letter-spacing: .04em;
}

/* Page fade-in */
body.loading::before { opacity: 1; }
body.loaded::before { opacity: 0; transform: scale(1); }
body.loading main,
body.loading .nav,
body.loading footer {
	opacity: 0;
	transform: translateY(18px) scale(.992);
	filter: blur(10px);
}
main, .nav, footer {
	transition:
		opacity .9s cubic-bezier(.22,1,.36,1),
		transform 1s cubic-bezier(.22,1,.36,1),
		filter 1s cubic-bezier(.22,1,.36,1);
}
body.loaded .nav   { transition-delay: .04s; opacity: 1; transform: none; filter: blur(0); }
body.loaded main   { transition-delay: .14s; opacity: 1; transform: none; filter: blur(0); }
body.loaded footer { transition-delay: .24s; opacity: 1; transform: none; filter: blur(0); }

/* Nav */
.nav {
	position: fixed; top: 0; left: 0; right: 0;
	display: flex; justify-content: space-between; align-items: center;
	padding: 1.25rem 2rem; z-index: 5;
}
.brand-wrap { display: inline-flex; align-items: center; gap: .6rem; position: relative; }
.brand { color: var(--fg); font-weight: 400; }
nav .link { color: var(--fg); }

/* Avatar */
.avatar {
	position: relative; width: 28px; height: 28px; padding: 0;
	border-radius: 50%; overflow: hidden; background: transparent;
	cursor: default;
}
.avatar[aria-expanded="true"] { outline: 1px solid rgba(0,0,0,.2); outline-offset: 3px; }
.avatar:not([disabled]) { cursor: pointer; }
.avatar img {
	width: 28px; height: 28px; border-radius: 50%; display: block;
	background: #eee; object-fit: cover;
	transition: opacity .25s ease;
}

/* Now-playing strip */
.pop {
	position: absolute; top: calc(100% + 10px); left: 0;
	width: 280px;
	background: rgba(255,255,255,.92);
	color: var(--fg);
	padding: 12px;
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 11px; letter-spacing: .03em;
	border: 1px solid rgba(10,10,10,.12);
	box-shadow: 0 14px 40px rgba(10,10,10,.08);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	opacity: 0; transform: translateY(-4px);
	transition: opacity .2s, transform .2s;
	pointer-events: none; z-index: 20;
	overflow: hidden;
}
.pop[data-open="true"] { opacity: 1; transform: none; pointer-events: auto; }
.pop__idle { color: var(--muted); }

.np { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; }
.np__art { width: 36px; height: 36px; background: #111; display: grid; place-items: center; color: #fff; overflow: hidden; position: relative; border-radius: 10px; }
.np__art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np__art.spotify { background: #1db954; color: #000; }
.np__meta { min-width: 0; }
.np__kind { color: var(--muted); text-transform: uppercase; font-size: 9px; letter-spacing: .12em; margin-bottom: 2px; }
.np__title { color: var(--fg); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np__sub { color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.np + .np { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(10,10,10,.08); }

.ch { display: inline-block; opacity: 0; transform: translateY(0.6em); filter: blur(4px); animation: charIn .55s cubic-bezier(.7,.05,.2,1) forwards; }
@keyframes charIn { to { opacity: 1; transform: none; filter: blur(0); } }

/* Nav links */
nav { display: flex; gap: 1.75rem; }
.link {
	display: inline-block;
	font-variation-settings: "wght" 400, "SOFT" 50, "WONK" 0;
	transition: font-variation-settings .5s cubic-bezier(.7,.05,.2,1);
}
.link:hover { font-variation-settings: "wght" 800, "SOFT" 100, "WONK" 1; }

/* Layout */
main { padding: 7rem 2rem 4rem; max-width: 1080px; margin: 0 auto; }

/* Hero */
.hero { padding: 5rem 0 4rem; }
.display {
	font-weight: 300;
	font-size: clamp(2.5rem, 8vw, 6.5rem);
	line-height: .98; letter-spacing: -.03em;
	max-width: 14ch;
	font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 0, "wght" 300;
	filter: url(#liquid);
	will-change: font-variation-settings;
}
.display em {
	font-style: italic; font-weight: 500;
	font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1, "wght" 500;
}
.lede { max-width: 38ch; margin-top: 2rem; color: #333; font-size: 20px; }

/* Contact */
.contact--top { padding: 1rem 0 3rem; border-bottom: 1px solid var(--hair); margin-bottom: 3rem; }
.socials { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem .75rem; }
.social {
	display: inline-flex; align-items: center; gap: .6rem;
	padding: .7rem 1rem; border: 1px solid var(--hair); border-radius: 999px;
	background: transparent; color: var(--fg);
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 13px; letter-spacing: .02em; cursor: pointer;
	position: relative; overflow: hidden; isolation: isolate;
	transition: background .35s cubic-bezier(.7,.05,.2,1), color .35s ease, border-color .35s ease, transform .25s ease;
}
.social::after {
	content: "";
	position: absolute; inset: 0;
	background: linear-gradient(120deg, transparent 15%, rgba(255,255,255,.2) 50%, transparent 85%);
	transform: translateX(-130%);
	transition: transform .55s cubic-bezier(.7,.05,.2,1);
	pointer-events: none;
}
.social:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); transform: translateY(-2px); }
.social:hover::after { transform: translateX(130%); }
.social:active { transform: translateY(-1px); }
.social svg { display: block; }
.social__label { white-space: nowrap; }
#discordBtn.copied { background: var(--fg); color: var(--bg); border-color: var(--fg); }
#discordBtn.copied .social__label::after { content: " — copied"; opacity: .7; }

.section-title {
	font-family: "JetBrains Mono", monospace; font-size: 12px;
	text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
	margin-bottom: 1.5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--hair);
}

.work { padding: 4rem 0; }
.projects { list-style: none; }
.projects li {
	display: flex; justify-content: space-between; align-items: baseline;
	padding: 1.25rem 0; border-bottom: 1px solid var(--hair);
	transition: padding .45s cubic-bezier(.7,.05,.2,1);
}
.projects li:hover { padding-left: 1.5rem; }
.project { font-size: clamp(1.4rem, 3vw, 2rem); cursor: pointer; }
.meta { color: var(--muted); transition: color .35s ease, transform .35s cubic-bezier(.7,.05,.2,1); }
.projects li:hover .meta { color: #666; transform: translateX(2px); }

.about { padding: 4rem 0 8rem; }
.about p { max-width: 52ch; font-size: 22px; }

footer {
	padding: 1.25rem 2rem; border-top: 1px solid var(--hair);
	display: flex; justify-content: space-between; color: var(--muted);
}

@supports (animation-timeline: view()) {
	.reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% cover 25%; }
	@keyframes reveal {
		from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
		to   { opacity: 1; transform: none; filter: blur(0); }
	}
}
@supports not (animation-timeline: view()) { .reveal { opacity: 1; } }

/* Footer time */
.flap {
	display: inline-block;
	color: var(--fg);
	letter-spacing: .06em;
	min-width: 15ch;
	text-align: right;
}

/* ===== Modal ===== */
.modal {
	position: fixed; inset: 0; z-index: 100;
	display: grid; place-items: center;
	visibility: hidden;
	transition: visibility 0s linear .5s;
}
.modal[data-open="true"] { visibility: visible; transition-delay: 0s; }
.modal__backdrop {
	position: absolute; inset: 0;
	background: rgba(255,255,255,.55);
	backdrop-filter: blur(14px) saturate(120%);
	-webkit-backdrop-filter: blur(14px) saturate(120%);
	opacity: 0;
	transition: opacity .35s ease;
}
.modal[data-open="true"] .modal__backdrop { opacity: 1; }
.modal__sheet {
	position: relative;
	width: min(520px, 92vw);
	background: var(--fg); color: var(--bg);
	clip-path: inset(49% 0 49% 0);
	transition: clip-path .5s cubic-bezier(.7,.05,.2,1);
	will-change: clip-path;
}
.modal[data-open="true"] .modal__sheet { clip-path: inset(0 0 0 0); }
.modal__line { display: none; }
.modal__inner {
	padding: 2rem 2rem 1.75rem;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .3s ease .2s, transform .3s ease .2s;
}
.modal[data-open="true"] .modal__inner { opacity: 1; transform: none; }

.mp__eyebrow {
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
	color: #888; margin-bottom: .75rem;
	display: flex; align-items: center; gap: .5rem;
}
.mp__eyebrow::before { content: ""; width: 20px; height: 1px; background: #888; }
.mp__eyebrow--loading { color: #9a9a9a; }
.mp__dots { display: inline-flex; align-items: center; gap: 3px; margin-left: .15rem; }
.mp__dots span {
	width: 3px; height: 3px; border-radius: 50%;
	background: currentColor; opacity: .25;
	animation: dotPulse 1s ease-in-out infinite;
}
.mp__dots span:nth-child(2) { animation-delay: .12s; }
.mp__dots span:nth-child(3) { animation-delay: .24s; }
.mp__title {
	font-family: "Fraunces", serif;
	font-size: clamp(1.8rem, 4vw, 2.6rem);
	line-height: 1; letter-spacing: -.02em;
	font-variation-settings: "opsz" 144, "wght" 400;
	margin-bottom: .85rem;
}
.mp__desc {
	font-family: "Fraunces", serif;
	font-size: 15px; line-height: 1.5; color: #ddd;
	margin-bottom: 1.25rem; max-width: 48ch;
}
.mp__stats {
	display: flex; gap: 1.25rem; flex-wrap: wrap;
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 11px; color: #aaa; letter-spacing: .04em;
	padding: .75rem 0; margin-bottom: 1.25rem;
	border-top: 1px solid rgba(255,255,255,.1);
	border-bottom: 1px solid rgba(255,255,255,.1);
}
.mp__stat { opacity: 0; transform: translateY(4px); animation: statIn .35s cubic-bezier(.22,1,.36,1) forwards; }
.mp__stat:nth-child(1) { animation-delay: .03s; }
.mp__stat:nth-child(2) { animation-delay: .09s; }
.mp__stat:nth-child(3) { animation-delay: .15s; }
.mp__stat:nth-child(4) { animation-delay: .21s; }
.mp__stat strong { color: #fff; font-weight: 500; margin-right: .3rem; }
.mp__lang { display: inline-flex; align-items: center; gap: .35rem; }
.mp__lang-icon { width: 16px; height: 16px; display: block; flex: 0 0 auto; }
.mp__lang-text { line-height: 1; }
.mp__cta {
	display: inline-flex; align-items: center; gap: .6rem;
	padding: .85rem 1.1rem;
	background: var(--bg); color: var(--fg);
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 12px; letter-spacing: .04em;
	position: relative; overflow: hidden;
	transition: transform .2s cubic-bezier(.7,.05,.2,1);
}
.mp__cta::after {
	content: ""; position: absolute; inset: 0;
	background: #1db954; transform: translateX(-101%);
	transition: transform .35s cubic-bezier(.7,.05,.2,1);
	z-index: 0;
}
.mp__cta:hover::after { transform: translateX(0); }
.mp__cta:hover { transform: translateY(-1px); }
.mp__cta:active { transform: translateY(0); }
.mp__cta > * { position: relative; z-index: 1; }
.mp__cta svg { display: block; }
.mp__close {
	position: absolute; top: .9rem; right: 1rem;
	font-family: "JetBrains Mono", monospace; font-size: 11px;
	color: #888; letter-spacing: .08em;
}
.mp__close:hover { color: #fff; }
.mp__skeleton {
	height: 120px;
	border: 1px solid rgba(255,255,255,.08);
	border-radius: 10px;
	background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.1), rgba(255,255,255,.04));
	background-size: 220% 100%;
	animation: shimmer 1.1s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes dotPulse {
	0%, 80%, 100% { opacity: .25; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-1px); }
}
@keyframes statIn {
	to { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
	.nav { position: static; padding: 1rem; }
	main { padding-top: 1rem; }
	.projects li { flex-direction: column; gap: .25rem; align-items: flex-start; }
	.display { filter: none; }
	.pop { left: 0; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.display { filter: none; }
	.modal__inner { opacity: 1; transform: none; }
	.modal__sheet { clip-path: inset(0); }
	body::before { display: none; }
	body.loading main, body.loading .nav, body.loading footer { opacity: 1; transform: none; filter: none; }
}
