/* Vangel — homepage styles */

/* Postman's Serif Light for the introduction */
@font-face {
	font-family: "Postmans Serif";
	src: url("fonts/postmans-serif-light.woff2") format("woff2");
	font-weight: 300;
	font-display: swap;
}

/* HEY Schmal: H, E and Y from Test Söhne Schmal Fett (Klim, trial licence),
   plus an exclamation mark built from its I stroke and a round dot (the trial has no "!") */
@font-face {
	font-family: "HEY Schmal";
	src: url("fonts/hey-schmal.woff2") format("woff2");
	font-weight: 400;
	font-display: block;
}

@font-face {
	font-family: "Inter";
	src: url("fonts/inter-var.woff2") format("woff2");
	font-weight: 100 900;
	font-display: block;
}

:root {
	--blue: #2b3aff;
	--grey: #e9e9ec;
	/* set by the scroll script, in px */
	--s: 1;
	--fx: 0px; --fy: 0px; --fw: 100vw; --fh: 100vh;   /* blue fill */
	--line: 100vh;                                    /* white above, blue below */
	--sel: 0;                                         /* outline + handles */
	--shift: 0px;                                     /* HEY! settles 21px right, as in Figma */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* the page itself carries the pink grid too (fixed, like every stage), so wherever two sections
   hand over there is never a plain white gap */
html, body {
	background-color: #fff;
	background-image:
		linear-gradient(rgb(255 234 233) 1px, transparent 1px),
		linear-gradient(90deg, rgb(255 234 233) 1px, transparent 1px);
	background-size: 32px 32px;
	background-position: center center;
	background-attachment: fixed;
}

body {
	font-family: "Inter", system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
}

/* ─── Intro: scroll-driven, frames 8:200 → 8:250 ─── */
.intro { height: 690vh; }   /* 544vh + the greeting hold and its doodles */

.stage {
	position: sticky;
	top: 0;
	height: 100vh;
	height: 100dvh;
	height: var(--vh, 100dvh);   /* the visible screen, kept up to date by the intro script as phone bars come and go */
	overflow: hidden;
	/* faint blue paper grid, the same as the work section */
	background-color: #fff;
	background-image:
		linear-gradient(rgb(255 234 233) 1px, transparent 1px),
		linear-gradient(90deg, rgb(255 234 233) 1px, transparent 1px);
	background-size: 32px 32px;
	background-position: center center;
	background-attachment: fixed;          /* lines up with the work section's grid */
}

/* once the blue has covered everything, the HEY! scene is gone for good:
   when the blue drains away again, only the grid is left */
.flooded .box-bg, .flooded .fill, .flooded .fill-back, .flooded .frame, .flooded .word { visibility: hidden !important; }

/* the box stays white inside, over the pattern */
.box-bg {
	position: absolute;
	left: var(--fx);
	top: var(--fy);
	width: var(--fw);
	height: var(--frh);
	background: #fff;
}

/* the blue: a clip-path polygon drawn by the script, so its surface can be liquid */
/* the ASCII blob field lives inside the blue panel: it is clipped (and so hidden) with it */
.blob { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: var(--blob, 1); }
.fill, .fill-back {
	position: absolute;
	inset: 0;
	background: var(--blue);
	pointer-events: none;
}

/* a lighter wave just behind the surface, for depth */
.fill-back { background: #ff3b30; }

.frame {
	position: absolute;
	/* sits exactly on the edges of the blue box and follows it all the way */
	left: var(--fx);
	top: var(--fy);
	width: var(--fw);
	height: var(--frh);
	border: 1px solid rgba(255, 59, 48, var(--sel));   /* the selection is red, like the wave behind the blue */
	pointer-events: none;
	z-index: 3;   /* always on top of the white letters, so the outline and handles stay crisp */
}

.handle {
	position: absolute;
	width: calc(16px * var(--s));
	height: calc(16px * var(--s));
	min-width: 10px;
	min-height: 10px;
	background: #fff;
	border: 1px solid #ff3b30;
	opacity: var(--sel);
	transform: translate(-50%, -50%);
}

.handle--tl { left: 0; top: 0; }
.handle--tr { left: 100%; top: 0; }
.handle--bl { left: 0; top: 100%; }
.handle--br { left: 100%; top: 100%; }

/* the same word twice, split along one horizontal line */
.word {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	pointer-events: none;
}

.word span {
	font-family: "HEY Schmal", "Inter", sans-serif;
	font-weight: 400;
	/* 200px at 1440px wide */
	font-size: calc(200px * var(--s));
	line-height: 1.21;
	white-space: nowrap;
	transform: translateX(var(--shift)) scale(var(--k, 1));   /* phones: the word shrinks away with the box */
	display: block;
}
/* the word is your SVG: 144 units tall, the cap height of the 200px type it replaces */
.hey-svg { display: block; height: calc(144px * var(--s)); width: auto; fill: currentColor; }

/* HEY! is blue everywhere, and white wherever the blue water is (same polygon as the fill) */
.word--white { color: #fff; }
/* 3D HEY!: white extruded letters inside the blue box. They take over from the flat word as soon as WebGL is
   ready (the flat SVG stays as the fallback), and share the box's clip, so the box still closes on them. */
#hey3d { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; visibility: hidden; }
.is-3d #hey3d { visibility: visible; }
.is-3d .word--white svg { visibility: hidden; }
.flooded #hey3d { visibility: hidden !important; }

/* "Good to see you": written on the white once HEY! has closed up; each line rises out of its own slot */
.greet {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: calc(30px * var(--s));
	color: var(--blue);
	pointer-events: none;
	visibility: hidden;
}
.greet__line { display: block; overflow: hidden; padding-bottom: calc(4px * var(--s)); }
.greet__line svg { display: block; width: calc(347px * 1.15 * var(--s)); height: auto; fill: currentColor; transform: translateY(calc(var(--g, 0) * 1%)); }
.greet__line:nth-child(2) svg { transform: translateY(calc(var(--g2, 0) * 1%)); }
.flooded .greet { visibility: hidden !important; }
/* doodles in blue ink around the greeting: the grid is a canvas, so someone sketches on it.
   Each one draws itself stroke by stroke as you scroll, with a slight hand-drawn wobble. */
.doodles { position: absolute; inset: 0; pointer-events: none; visibility: hidden; }
.doodle {
	position: absolute; width: calc(var(--sz) * 1px * var(--ds, 1.35)); height: auto; overflow: visible;
	transform: translate(-50%, -50%) rotate(var(--rot));
	fill: none; stroke: var(--blue); stroke-linecap: round; stroke-linejoin: round; filter: url(#inkWobble);
	stroke-width: calc(2.6px * var(--vb, 100) / (var(--sz) * var(--ds, 1.35)));   /* about 2.6px on screen, whatever the doodle's size */
}
.doodle path { stroke-dasharray: 1 1; stroke-dashoffset: var(--draw, 1); }
.flooded .doodles { visibility: hidden !important; }
@media (max-width: 700px) { .doodle { --ds: .78; } .doodle--side { display: none; } }   /* the two beside the phrase would sit on it */


/* the blue floods back in over everything, with a grainy, eroded edge */
#flood {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	visibility: hidden;
}

/* ─── About: the section on the blue. It holds the lanyard and the badge, and only shows while the blue is up ─── */
.about { position: absolute; inset: 0; pointer-events: none; visibility: hidden; }

/* ─── About as a badge on a lanyard (after two pretzel.design finds: an ID badge that swings from a lanyard,
       and a collectible card that tilts and glitters under the cursor). It hangs on the blue, swings, can be
       grabbed and thrown, tilts towards the pointer, and its blue panel glitters where the light hits. ─── */
.lanyard { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.lanyard__band { fill: #0d1466; }
.lanyard__weave { font: 700 9px/1 "Inter", system-ui, sans-serif; letter-spacing: .18em; fill: rgba(255, 255, 255, .55); dominant-baseline: middle; }
.badge {
	--bw: 300px;
	position: absolute; left: 0; top: 0; width: var(--bw);
	transform-origin: 50% 0; will-change: transform; perspective: 900px;
	pointer-events: auto; cursor: grab; touch-action: pan-y; user-select: none;   /* a vertical swipe still scrolls the page */ -webkit-user-select: none;
}
.badge.is-held { cursor: grabbing; }
.badge__clip {
	position: absolute; left: 50%; top: -22px; width: 26px; height: 30px; margin-left: -13px; border-radius: 6px;
	background: linear-gradient(180deg, #e9ebf5, #9aa0bd); box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .18);
}
.badge__clip::after { content: ""; position: absolute; left: 7px; right: 7px; top: 9px; height: 5px; border-radius: 3px; background: #4a5070; }
.badge__card {
	position: relative; border-radius: 18px; background: #fff; padding: 12px; overflow: hidden;
	transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
	box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 30px 60px -18px rgba(5, 10, 80, .55), 0 10px 24px -10px rgba(5, 10, 80, .4);
}
.badge__slot { position: absolute; left: 50%; top: 9px; width: 54px; height: 9px; margin-left: -27px; border-radius: 5px; background: #2b3aff; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35); z-index: 3; }
.badge__art { position: relative; aspect-ratio: 1 / .78; border-radius: 10px; background: #eef0ff; overflow: hidden; display: grid; place-items: center; margin-top: 14px; }
.badge__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; padding: 12px 0 0; pointer-events: none; }   /* the portrait stands on the panel's bottom edge */
.badge__in {
	position: absolute; right: 10px; top: 10px; z-index: 3; width: 32px; height: 32px; border-radius: 9px;
	display: grid; place-items: center; background: #fff; color: var(--blue); cursor: pointer;
	box-shadow: 0 4px 12px rgba(5, 10, 80, .25); transition: transform .2s ease, background .2s ease, color .2s ease;
}
.badge__in svg { width: 18px; height: 18px; fill: currentColor; }
.badge__in:hover { transform: translateY(-1px) scale(1.06); background: var(--blue); color: #fff; }
.badge__in:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.badge__in:not([href]) { display: none; }   /* no link yet: no icon */
.badge__no { position: absolute; left: 12px; top: 12px; font: 600 10px/1 "Inter", system-ui, sans-serif; letter-spacing: .12em; color: var(--blue); z-index: 3; }
/* the foil: an iridescent sweep that slides with the tilt, and glitter that only catches where the light is */
.badge__holo, .badge__glitter, .badge__shine { position: absolute; inset: 0; pointer-events: none; }
.badge__holo {
	z-index: 2; mix-blend-mode: multiply; opacity: calc(.06 + var(--lit, 0) * .4);
	background: linear-gradient(115deg, transparent 20%, #6d7bff 34%, #ff7ad9 44%, #7cf2ff 54%, #a68bff 64%, transparent 78%);
	background-size: 260% 260%; background-position: calc(50% + var(--px, 0) * 60%) calc(50% + var(--py, 0) * 60%);
}
.badge__glitter {
	z-index: 2; mix-blend-mode: multiply; background-image: var(--glitter); background-size: 160px 160px;
	background-position: calc(var(--px, 0) * 22px) calc(var(--py, 0) * 22px);
	-webkit-mask-image: radial-gradient(circle at var(--mx, 50%) var(--my, 40%), #000 0, rgba(0, 0, 0, .55) 22%, transparent 58%);
	mask-image: radial-gradient(circle at var(--mx, 50%) var(--my, 40%), #000 0, rgba(0, 0, 0, .55) 22%, transparent 58%);
	opacity: calc(.2 + var(--lit, 0) * .8);
}
.badge__shine { z-index: 4; border-radius: inherit; background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 45%); mix-blend-mode: soft-light; opacity: var(--lit, 0); }
.badge__body { padding: 16px 8px 6px; color: #0b0b0f; }
.badge__kicker { font: 600 10px/1 "Inter", system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }
.badge__name { margin-top: 10px; font: 300 40px/1 "Postmans Serif", Georgia, serif; letter-spacing: -.02em; color: #000; }
.badge__role { margin-top: 4px; font: 400 14px/1.3 "Inter", system-ui, sans-serif; color: #6e6e73; }
.about__text { margin-top: 14px; font: 400 14px/1.45 "Inter", system-ui, sans-serif; color: #0b0b0f; }
.badge__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 16px; padding-top: 12px; border-top: 1px dashed rgba(0, 0, 0, .14); font: 500 11px/1 "Inter", system-ui, sans-serif; }
.badge__foot span { flex-basis: 100%; color: #8a8a90; margin-bottom: 2px; }
.badge__foot i { font-style: normal; padding: 6px 9px; border-radius: 999px; background: #eef0ff; color: var(--blue); }
@media (max-width: 700px) { .badge { --bw: 250px; } .badge__name { font-size: 34px; } .about__text { font-size: 13px; } }

.about__text .w { opacity: var(--o, 1); transition: opacity .25s linear; }


.js-words .about__text .w { --o: .22; }

/* ─── Work: the projects on a honey ring (see the ring script). The section is one screen; the ring takes
       the scroll, the arrows and the keys, and the caption names the project in front. ─── */
.work {
	position: relative;
	z-index: 2;
	height: calc(100vh + 2px);   /* one screen: the projects are browsed with the controls, not the scroll */
	height: calc(100svh + 2px);
	/* the canvas starts rising during the intro's last screen, while the blue is still draining away,
	   so the projects appear right after it instead of after a screen of empty grid */
	margin-top: -80vh;
	margin-top: -80svh;
}

.work__stage {
	position: sticky;
	top: 0;
	height: 100vh;
	height: 100dvh;
	height: var(--vh, 100dvh);
	overflow: hidden;
}
/* While the canvas rises over the intro's last screen its stage is see-through, so the blue keeps
   draining behind the frames over the intro's grid. Once it pins, the grid gives way to Figma's
   dot canvas, which pans and zooms with the camera (see draw). */
.work__stage::before {
	content: "";
	position: absolute;
	inset: 0;
	background-color: #fff;
	background-image: radial-gradient(circle, rgba(0, 0, 0, .12) 1px, transparent 1.3px);
	background-size: var(--dot, 24px) var(--dot, 24px);
	background-position: var(--dx, 0) var(--dy, 0);
	opacity: 0;
	transition: opacity .6s ease;
}
.work.pinned .work__stage::before { opacity: 1; }

/* the ring is fixed to the screen, so it is already in place, whole, while the blue drains off it;
   it only takes the pointer once the section has settled */
.ring { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: var(--vh, 100vh); display: block; cursor: grab; touch-action: pan-x; pointer-events: none; }
.work.pinned .ring { pointer-events: auto; }
/* the caption and its fade come in just after, so the drain stays the moment */
.work__caption, .work__stage::after { opacity: 0; transition: opacity .5s ease .15s; }
.work.pinned.zoomed .work__caption, .work.pinned.zoomed .work__stage::after { opacity: 1; }
.no-gl .ring { display: none; }
/* the way back up: the ring takes the scroll, so this rewinds the page to the intro */
.work__top {
	position: absolute; left: 48px; top: 36px; z-index: 2;
	display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border: 0; border-radius: 999px;
	background: rgba(255, 255, 255, .92); color: #000; font: 500 13px/1 "Inter", system-ui, sans-serif; cursor: pointer;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 6px 18px rgba(0, 0, 0, .08); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	opacity: 0; pointer-events: none; transition: opacity .4s ease, background .2s ease, transform .2s ease;
}
.work.pinned .work__top { opacity: 1; pointer-events: auto; }
.work__top:hover { background: var(--blue); color: #fff; }
.work__top:hover span { transform: translateY(-2px); }
.work__top span { display: inline-block; transition: transform .2s ease; }
.work__top:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.work.diving .work__top { opacity: 0; }
@media (max-width: 700px) {
	.work__top { left: 20px; top: 20px; }
	.work .work__stage::after { height: max(300px, 44vh); background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, .96) 38%, #fff 52%); }   /* the caption sits over the next card on a phone */
}
.no-gl::after { content: "The projects need WebGL, which this browser has turned off."; position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); font: 400 15px/1.5 "Inter", sans-serif; color: #6e6e73; }

/* caption for the project in front */
.work__caption {
	position: absolute;
	left: 48px;
	right: 48px;
	bottom: 40px;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 32px;
	pointer-events: none;
}

.work__caption > * { pointer-events: auto; }
/* soft white fade behind the caption so neighbouring frames never clash with it */
.work__stage::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 220px;
	background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, .92) 70%);
	pointer-events: none;
}
.work__caption { z-index: 1; }
.work__title { font: 300 44px/1.05 "Postmans Serif", Georgia, serif; color: #000; }
.work__summary { margin-top: 8px; font: 400 15px/1.5 "Inter", system-ui, sans-serif; color: #6e6e73; max-width: 44ch; }
.work__aside { display: flex; align-items: center; gap: 20px; font: 500 13px/1 "Inter", system-ui, sans-serif; }
.work__count { color: #a1a1a6; font-variant-numeric: tabular-nums; min-width: 52px; text-align: center; }
.work__nav { display: flex; align-items: center; gap: 6px; }
.work__btn {
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 999px;
	background: rgba(0, 0, 0, .05);
	color: #000;
	font: 500 16px/1 "Inter", system-ui, sans-serif;
	cursor: pointer;
	transition: background .2s ease, opacity .2s ease;
}
.work__btn:hover { background: rgba(0, 0, 0, .1); }
.work__btn:disabled { opacity: .3; cursor: default; }
.work__btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.work__open {
	padding: 12px 18px;
	border-radius: 999px;
	background: var(--blue);
	color: #fff;
	text-decoration: none;
	transition: transform .2s ease, opacity .2s ease;
}
.work__open:hover { transform: translateY(-1px); }
.work__open[hidden] { display: none; }
.work__open:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

@media (max-width: 700px) {
	.work__caption { left: 20px; right: 20px; bottom: 24px; flex-direction: column; align-items: flex-start; gap: 16px; }
	.work__title { font-size: 32px; }
}
