/* ============================================================
   Marcus Rein — mrein.dev
   Refined editorial-dark. Fraunces + Hanken Grotesk + JetBrains Mono.
   ============================================================ */

:root {
	--bg:        #0c0b0e;
	--bg-soft:   #131217;
	--surface:   #15141a;
	--surface-2: #191820;
	--line:      rgba(255, 255, 255, 0.08);
	--line-soft: rgba(255, 255, 255, 0.05);
	--text:      #ece8e3;
	--text-dim:  #a7a29b;
	--text-faint:#726d67;
	--accent:    #ff7a4d;
	--accent-dim:#c75f3a;

	--display: "Fraunces", Georgia, "Times New Roman", serif;
	--body:    "Hanken Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
	--mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

	--maxw: 680px;
	--radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }

body {
	margin: 0;
	background-color: var(--bg);
	background-image: radial-gradient(85% 45% at 50% -12%, rgba(255, 122, 77, 0.045), transparent 72%);
	background-repeat: no-repeat;
	background-attachment: fixed;
	color: var(--text);
	font-family: var(--body);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* fine film grain overlay */
.grain {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	opacity: 0.02;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.page {
	position: relative;
	z-index: 1;
	max-width: var(--maxw);
	margin: 0 auto;
	padding: clamp(1.5rem, 3.5vw, 2.75rem) clamp(1.25rem, 5vw, 2.5rem) 4rem;
}

/* ===================== HERO ===================== */
.hero {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: clamp(1.5rem, 4vw, 2.75rem);
	align-items: center;
	margin-bottom: clamp(2rem, 4vw, 3rem);
}

.hero-photo {
	position: relative;
	width: clamp(92px, 21vw, 132px);
	aspect-ratio: 1;
	border-radius: 50%;
}
.hero-photo img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	border: 1px solid var(--line);
}

.eyebrow {
	font-size: 0.92rem;
	color: var(--text-faint);
	margin: 0 0 0.6rem;
}

h1 {
	font-family: var(--display);
	font-weight: 500;
	font-size: clamp(2.6rem, 8vw, 4.1rem);
	line-height: 0.98;
	letter-spacing: -0.02em;
	margin: 0 0 0.55rem;
}

.role {
	font-family: var(--display);
	font-style: italic;
	font-weight: 400;
	font-size: clamp(1.05rem, 2.6vw, 1.3rem);
	color: var(--text-dim);
	margin: 0;
}
.role .at { color: var(--accent); font-style: normal; }

/* confident statement under the hero */
.statement {
	font-family: var(--display);
	font-weight: 400;
	font-size: clamp(1.45rem, 4.2vw, 2.15rem);
	line-height: 1.3;
	letter-spacing: -0.015em;
	max-width: none;
	margin: clamp(2rem, 5vw, 3rem) 0 clamp(2.25rem, 5vw, 3.25rem);
}
.statement .hl { color: var(--accent); font-style: italic; }
.statement .sub {
	display: block;
	margin-top: 1.1rem;
	font-family: var(--body);
	font-size: 1.02rem;
	line-height: 1.6;
	letter-spacing: normal;
	color: var(--text-dim);
	max-width: none;
}

/* subtle "elsewhere" line under the statement */
.elsewhere {
	font-family: var(--display);
	font-style: italic;
	font-size: 1.04rem;
	color: var(--text-faint);
	max-width: 52ch;
	margin: -0.75rem 0 0;
	line-height: 1.55;
}
.elsewhere a {
	color: var(--text-dim);
	text-decoration: none;
	border-bottom: 1px solid var(--line);
	transition: color .2s ease, border-color .2s ease;
}
.elsewhere a:hover { color: var(--accent); border-color: var(--accent-dim); }

/* social icon row */
.socials {
	display: flex;
	flex-wrap: wrap;
	gap: 0.85rem;
	margin-top: 1.5rem;
	margin-bottom: clamp(2.25rem, 5vw, 3.25rem);
}
.socials a {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border: 1px solid var(--line);
	border-radius: 11px;
	color: var(--text-dim);
	background: var(--surface);
	transition: color .22s ease, border-color .22s ease, transform .22s ease, background .22s ease;
}
.socials svg { width: 18px; height: 18px; fill: currentColor; }
.socials a:hover {
	color: var(--accent);
	border-color: rgba(255,122,77,0.5);
	background: var(--surface-2);
	transform: translateY(-3px);
}

/* ===================== WORK ===================== */
.facets { display: block; }
.card-work { width: 100%; }

.card {
	position: relative;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: clamp(1.4rem, 3vw, 1.9rem);
	transition: border-color .25s ease, transform .25s ease, background .25s ease;
}
.card-label {
	font-family: var(--mono);
	font-size: 0.72rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--text-faint);
	margin: 0 0 1.35rem;
	padding-bottom: 0.7rem;
	border-bottom: 1px solid var(--line-soft);
}

/* selected work */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6rem; }
.timeline li { position: relative; }
.tl-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 0.35rem;
}
.timeline h3 {
	font-family: var(--display);
	font-weight: 500;
	font-size: 1.15rem;
	letter-spacing: -0.01em;
	margin: 0;
	line-height: 1.25;
}
.timeline h3 .muted { color: var(--text-dim); font-weight: 400; }
.timeline h3 a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--accent-dim); }
.timeline h3 a:hover { color: var(--accent); }
.timeline p {
	margin: 0;
	font-size: 0.95rem;
	color: var(--text-dim);
	max-width: none;
}
.timeline p a {
	color: var(--text);
	text-decoration: none;
	border-bottom: 1px solid var(--accent-dim);
	transition: color .2s ease, border-color .2s ease;
}
.timeline p a:hover { color: var(--accent); border-color: var(--accent); }
.timeline em { color: var(--text); font-style: italic; }
.timeline .now {
	color: var(--accent);
	font-family: var(--mono);
	font-size: 0.62rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	vertical-align: middle;
	border: 1px solid rgba(255,122,77,0.4);
	border-radius: 999px;
	padding: 0.12em 0.5em;
	margin-left: 0.5rem;
}
.date {
	font-family: var(--mono);
	font-size: 0.72rem;
	color: var(--text-faint);
	white-space: nowrap;
	letter-spacing: 0.02em;
}


.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.link-list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.6rem 0;
	color: var(--text);
	text-decoration: none;
	font-size: 0.98rem;
	border-bottom: 1px solid var(--line-soft);
	transition: color .2s ease, padding-left .2s ease;
}
.link-list li:last-child a { border-bottom: none; }
.link-list a::after { content: "\2197"; color: var(--text-faint); font-size: 0.85rem; transition: color .2s ease; }
.link-list a:hover { color: var(--accent); padding-left: 0.35rem; }
.link-list a:hover::after { color: var(--accent); }

/* ===================== SKILLS ===================== */
.skills {
	margin-top: clamp(1.5rem, 4vw, 2.5rem);
	padding: clamp(1.6rem, 3.5vw, 2.2rem);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.55rem; }
.tags li {
	font-size: 0.86rem;
	color: var(--text-dim);
	padding: 0.4rem 0.8rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--bg-soft);
	transition: color .2s ease, border-color .2s ease;
}
.tags li:hover { color: var(--text); border-color: rgba(255,122,77,0.4); }

.langs { margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line-soft); }
.langs-label {
	display: block;
	font-family: var(--mono);
	font-size: 0.7rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--text-faint);
	margin-bottom: 0.85rem;
}
.tags-mono li { font-family: var(--mono); font-size: 0.8rem; }

/* ===================== MOTION ===================== */
.reveal {
	opacity: 0;
	transform: translateY(14px);
	animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
	animation-delay: calc(var(--d, 0) * 75ms);
}
@keyframes rise {
	to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.reveal { animation: none; opacity: 1; transform: none; }
	* { scroll-behavior: auto; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 720px) {
	body { font-size: 16px; }
	.hero {
		grid-template-columns: 1fr;
		text-align: center;
		justify-items: center;
	}
	.statement { margin-inline: auto; text-align: center; }
	.statement .sub { margin-inline: auto; }
	.socials { justify-content: center; }
	.facets {
		grid-template-columns: 1fr;
	}
	.tl-head { justify-content: flex-start; }
}
