/* ==========================================================================
   Gabriele Guo · Portfolio
   One-screen overview (bento) + detail panels that open from each tile.
   Dependency-free. Without JS everything renders as plain sections.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
	--font-display: "Space Grotesk", system-ui, sans-serif;
	--font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--nav-h: 64px;
	--gap: 14px;
	--radius: 24px;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

:root,
:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #0c0c10;
	--tile: #15151b;
	--tile-hover: #1a1a21;
	--text: #efeff2;
	--muted: #8e8e9a;
	--line: rgba(255, 255, 255, 0.08);
	--line-strong: rgba(255, 255, 255, 0.16);
	--accent: #ff5a3c;
	--accent-soft: rgba(255, 90, 60, 0.14);
	--card: #f4f1ea;
	--card-ink: #17171c;
	--shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}

:root[data-theme="light"] {
	color-scheme: light;
	--bg: #f2f1ec;
	--tile: #ffffff;
	--tile-hover: #fdfcf9;
	--text: #14141a;
	--muted: #6c6c76;
	--line: rgba(20, 20, 26, 0.09);
	--line-strong: rgba(20, 20, 26, 0.18);
	--accent: #e2411f;
	--accent-soft: rgba(226, 65, 31, 0.1);
	--card: #ffffff;
	--card-ink: #17171c;
	--shadow: 0 30px 60px -30px rgba(40, 30, 20, 0.3);
}

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

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	transition: background-color 0.4s ease, color 0.4s ease;
}

body.has-panel {
	overflow: hidden;
}

img {
	display: block;
	max-width: 100%;
}

a {
	color: inherit;
	text-decoration: none;
}

button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}

ul,
ol {
	list-style: none;
	margin: 0;
	padding: 0;
}

h1,
h2,
h3,
h4 {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 500;
	letter-spacing: -0.02em;
	line-height: 1.1;
}

p {
	margin: 0;
}

::selection {
	background: var(--accent);
	color: #fff;
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
	border-radius: 6px;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: fixed;
	top: 10px;
	left: 10px;
	z-index: 200;
	padding: 0.6rem 1rem;
	border-radius: 8px;
	background: var(--text);
	color: var(--bg);
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
}

.muted {
	color: var(--muted);
}

.link {
	background-image: linear-gradient(currentColor, currentColor);
	background-size: 100% 1px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	transition: background-size 0.45s var(--ease), color 0.2s ease;
}

.link:hover {
	color: var(--accent);
	background-size: 0% 1px;
	background-position: 100% 100%;
}

.dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--accent);
	margin-right: 0.5rem;
	vertical-align: 0.1em;
}

@keyframes pulse {
	0% { box-shadow: 0 0 0 0 var(--accent-soft); }
	70% { box-shadow: 0 0 0 7px transparent; }
	100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Nav ---------- */
.nav {
	height: var(--nav-h);
}

.nav__inner {
	height: 100%;
	padding: 0 calc(var(--gap) + 10px);
	display: flex;
	align-items: center;
	gap: 1.25rem;
}

.nav__logo {
	font-family: var(--font-display);
	font-weight: 600;
	letter-spacing: -0.02em;
	margin-right: auto;
}

.nav__status {
	font-size: 0.85rem;
	color: var(--muted);
}

.theme-toggle {
	position: relative;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid var(--line);
	color: var(--muted);
	transition: color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
	color: var(--text);
	border-color: var(--line-strong);
}

.theme-toggle__icon {
	position: absolute;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 0.6s var(--spring), opacity 0.3s ease;
}

[data-theme="dark"] .theme-toggle__icon--moon,
[data-theme="light"] .theme-toggle__icon--sun {
	opacity: 0;
	transform: rotate(-90deg) scale(0.5);
}

/* ---------- Bento overview ---------- */
.bento {
	display: grid;
	gap: var(--gap);
	padding: 0 var(--gap) var(--gap);
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-template-areas:
		"intro intro journey projects"
		"intro intro now projects"
		"passions passions passions contact";
	grid-template-rows: auto auto auto;
}

/* Fit the whole story on one screen on regular desktops */
@media (min-width: 1101px) and (min-height: 700px) {
	.bento {
		height: calc(100vh - var(--nav-h));
		height: calc(100svh - var(--nav-h));
		grid-template-rows: 1fr 1fr 0.9fr;
	}
}

.tile {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	min-width: 0;
	min-height: 0;
	padding: clamp(1.1rem, 1.6vw, 1.6rem);
	border-radius: var(--radius);
	background: var(--tile);
	border: 1px solid var(--line);
	transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
	transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.4s ease;
}

.tile:has(.tile__link):hover {
	background: var(--tile-hover);
	border-color: var(--line-strong);
	box-shadow: var(--shadow);
}

.js .tile {
	opacity: 0;
	translate: 0 26px;
	animation: tile-in 0.9s var(--spring) forwards;
	animation-delay: calc(var(--i, 0) * 70ms + 80ms);
}

@keyframes tile-in {
	to {
		opacity: 1;
		translate: 0 0;
	}
}

/* Whole tile is clickable; inner interactive elements sit above the link */
.tile__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
}

.tile__link:focus-visible {
	outline: none;
}

.tile__link:focus-visible::after {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

.tile__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.tile__label {
	font-family: var(--font-mono);
	font-size: 0.74rem;
	font-weight: 400;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
}

.tile__arrow,
.tile__more span {
	display: inline-block;
	color: var(--muted);
	transition: transform 0.5s var(--spring), color 0.2s ease;
}

.tile:hover .tile__arrow,
.tile:hover .tile__more span {
	color: var(--accent);
	transform: translate(3px, -3px);
}

.tile__foot {
	margin-top: auto;
	font-size: 0.9rem;
	color: var(--muted);
}

.tile__foot strong {
	color: var(--text);
	font-weight: 500;
}

/* --- Intro --- */
/* The intro has no card around it: it's the starting point, with room to breathe */
.tile--intro {
	grid-area: intro;
	justify-content: space-between;
	gap: 1.5rem;
	z-index: 2;
	padding-left: clamp(0.5rem, 1.2vw, 1rem);
	padding-right: clamp(1rem, 3vw, 3rem);
	background: transparent;
	border-color: transparent;
}

.tile--intro:has(.tile__link):hover {
	background: transparent;
	border-color: transparent;
	box-shadow: none;
}

.intro__top {
	display: flex;
	align-items: center;
	gap: 0.9rem;
}

.intro__avatar {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
}

.namechip {
	position: relative;
	z-index: 2;
}

.namechip__btn {
	display: inline-flex;
	align-items: baseline;
	gap: 0.45rem;
	padding: 0.35rem 0.8rem;
	border-radius: 999px;
	border: 1px solid var(--line-strong);
	transition: border-color 0.2s ease;
}

.namechip__btn:hover,
.namechip.is-open .namechip__btn {
	border-color: var(--accent);
}

.namechip__han {
	font-size: 1rem;
	letter-spacing: 0.08em;
}

.namechip__pinyin {
	font-size: 0.8rem;
	color: var(--muted);
}

.namechip__tip {
	position: absolute;
	left: 0;
	top: calc(100% + 10px);
	width: min(300px, 70vw);
	padding: 0.8rem 1rem;
	border-radius: 14px;
	background: var(--text);
	color: var(--bg);
	font-size: 0.85rem;
	line-height: 1.5;
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	translate: 0 -6px;
	transition: opacity 0.25s ease, translate 0.4s var(--spring), visibility 0.25s;
}

.namechip:hover .namechip__tip,
.namechip:focus-within .namechip__tip,
.namechip.is-open .namechip__tip {
	opacity: 1;
	visibility: visible;
	translate: 0 0;
}

.greet {
	display: flex;
	align-items: flex-start;
	font-family: var(--font-display);
	font-size: clamp(2.8rem, 6.2vw, 6.2rem);
	font-weight: 500;
	letter-spacing: -0.045em;
	line-height: 1;
	color: var(--accent);
}

.greet__word {
	display: inline-block;
	white-space: nowrap;
}

.greet__lang {
	margin: 0.4em 0 0 0.6rem;
	padding: 0.2rem 0.45rem;
	border-radius: 6px;
	border: 1px solid var(--line-strong);
	font-family: var(--font-mono);
	font-size: 0.7rem;
	letter-spacing: 0.05em;
	color: var(--muted);
	white-space: nowrap;
}

.intro__name {
	font-size: clamp(2.8rem, 6.2vw, 6.2rem);
	letter-spacing: -0.045em;
	line-height: 1;
	margin: 0.05em 0 1.1rem;
}

.intro__lead {
	max-width: 30rem;
	font-size: clamp(1rem, 1.3vw, 1.15rem);
	color: var(--muted);
}

.tile__more {
	font-size: 0.9rem;
	font-weight: 500;
}

/* --- Journey --- */
.tile--journey {
	grid-area: journey;
}

.journey__role {
	font-family: var(--font-display);
	font-size: clamp(1.2rem, 1.6vw, 1.45rem);
	line-height: 1.2;
}

.journey__where {
	color: var(--muted);
	font-size: 0.9rem;
}

.path {
	position: relative;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	margin-top: auto;
	padding-top: 14px;
}

.path::before {
	content: "";
	position: absolute;
	top: 4px;
	left: 4px;
	right: 12%;
	height: 1px;
	background: var(--line-strong);
}

.path li {
	position: relative;
	display: flex;
	flex-direction: column;
	font-size: 0.72rem;
	line-height: 1.3;
}

.path li::before {
	content: "";
	position: absolute;
	top: -14px;
	left: 0;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--tile);
	border: 1px solid var(--line-strong);
	transition: transform 0.4s var(--spring);
}

.path li.is-now::before {
	background: var(--text);
	border-color: var(--text);
}

.tile--journey:hover .path li::before {
	transform: scale(1.3);
}

.path__year {
	font-family: var(--font-mono);
	color: var(--muted);
}

/* --- Projects (fanned mini deck) --- */
.tile--projects {
	grid-area: projects;
	overflow: hidden;
}

.fan {
	position: relative;
	flex: 1;
	min-height: 170px;
}

.fan__card {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 42%;
	max-width: 150px;
	aspect-ratio: 5 / 7;
	padding: 6px;
	border-radius: 12px;
	background: var(--card);
	box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.55);
	transform: translate(-50%, -50%) translateX(var(--x, 0)) translateY(var(--y, 0)) rotate(var(--r, 0deg));
	transform-origin: 50% 120%;
	transition: transform 0.7s var(--spring);
}

.fan__card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 7px;
}

.fan__card:nth-child(1) { --r: -9deg; --x: -14%; }
.fan__card:nth-child(2) { --r: 0deg; --y: -4%; }
.fan__card:nth-child(3) { --r: 9deg; --x: 14%; }

.tile--projects.is-live .fan__card:nth-child(1) { --r: -16deg; --x: -34%; }
.tile--projects.is-live .fan__card:nth-child(2) { --r: 0deg; --y: -10%; }
.tile--projects.is-live .fan__card:nth-child(3) { --r: 16deg; --x: 34%; }

/* --- Now building --- */
.tile--now {
	grid-area: now;
}

.network {
	width: 100%;
	flex: 1;
	min-height: 70px;
	overflow: visible;
}

.network path {
	fill: none;
	stroke: var(--line-strong);
	stroke-width: 1;
	stroke-dasharray: 4 6;
	transition: stroke 0.4s ease;
}

.network circle {
	fill: var(--muted);
	transform-box: fill-box;
	transform-origin: center;
	transition: fill 0.4s ease;
}

.network .hub {
	fill: var(--text);
}

/* The network only comes alive when the tile is "live" (hover, or in view on touch) */
.tile--now.is-live .network path {
	stroke: var(--accent);
	animation: flow 2s linear infinite;
}

.tile--now.is-live .network circle {
	fill: var(--text);
	animation: node 3s ease-in-out infinite;
}

.tile--now.is-live .network circle:nth-of-type(2n) { animation-delay: -1s; }
.tile--now.is-live .network circle:nth-of-type(3n) { animation-delay: -2s; }

.tile--now.is-live .network .hub {
	fill: var(--accent);
}

@keyframes flow {
	to { stroke-dashoffset: -60; }
}

@keyframes node {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.45); }
}

.now__title {
	font-family: var(--font-display);
	font-size: clamp(1.15rem, 1.5vw, 1.35rem);
	line-height: 1.2;
	margin-bottom: 0.25rem;
}

.now__desc {
	font-size: 0.88rem;
	color: var(--muted);
}

/* --- Passions --- */
.tile--passions {
	grid-area: passions;
	flex-direction: row;
	gap: 1.5rem;
	overflow: hidden;
}

.passions__text {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	flex: 1;
	min-width: 0;
}

.passions__title {
	font-family: var(--font-display);
	font-size: clamp(1.4rem, 2.3vw, 2.1rem);
	letter-spacing: -0.03em;
	line-height: 1.1;
	max-width: 22ch;
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: auto;
}

.chips li {
	padding: 0.25rem 0.7rem;
	border-radius: 999px;
	border: 1px solid var(--line);
	font-size: 0.8rem;
	color: var(--muted);
	transition: color 0.2s ease, border-color 0.2s ease, translate 0.4s var(--spring);
}

.tile--passions.is-live .chips li {
	color: var(--text);
	border-color: var(--line-strong);
}

.tile--passions.is-live .chips li:nth-child(odd) { translate: 0 -2px; }

.viewfinder {
	position: relative;
	flex: none;
	width: clamp(150px, 16vw, 230px);
	aspect-ratio: 4 / 5;
	align-self: center;
	max-height: 100%;
	border-radius: 14px;
	overflow: hidden;
	background:
		radial-gradient(circle at 50% 45%, var(--accent-soft), transparent 65%),
		var(--bg);
	border: 1px solid var(--line);
	color: var(--text);
}

/* One slide per passion; icons are simple line drawings */
.vf__slide {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	opacity: 0;
	scale: 0.85;
	filter: blur(4px);
	transition: opacity 0.6s ease, scale 0.8s var(--spring), filter 0.6s ease;
}

.vf__slide.is-current {
	opacity: 1;
	scale: 1;
	filter: none;
}

.vf__icon {
	/* Square icon sized by the shorter side, so it fits any viewfinder ratio */
	height: 50%;
	width: auto;
	aspect-ratio: 1;
	overflow: visible;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.vf__icon text {
	fill: currentColor;
	stroke: none;
	font-family: var(--font-body);
	font-size: 12px;
}

.vf__icon .vf__hello {
	font-size: 13px;
	fill: currentColor;
}

/* Small loops, only while the tile is live and the slide is on screen */
.is-live .is-current .vf__body { animation: pullup 1.6s var(--ease) infinite; }
.is-live .is-current .vf__lens { animation: focus 2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.is-live .is-current .vf__wheel { animation: spin 1.2s linear infinite; transform-box: fill-box; transform-origin: center; }

@keyframes pullup {
	0%, 100% { transform: translateY(6px); }
	45%, 55% { transform: translateY(-3px); }
}

@keyframes focus {
	0%, 100% { scale: 1; }
	50% { scale: 0.8; }
}

@keyframes spin {
	to { rotate: 360deg; }
}

#passion-chips {
	position: relative;
	z-index: 2;
	cursor: pointer;
}

/* Chip matching the passion shown in the viewfinder */
.chips li.is-on {
	color: var(--text);
	border-color: var(--text);
}

/* Corner brackets like a camera viewfinder */
.viewfinder::before,
.viewfinder::after {
	content: "";
	position: absolute;
	inset: 10px;
	z-index: 1;
	pointer-events: none;
	border: 1.5px solid var(--muted);
	transition: inset 0.6s var(--spring);
	-webkit-mask:
		linear-gradient(#000 0 0) top left / 16px 16px no-repeat,
		linear-gradient(#000 0 0) top right / 16px 16px no-repeat,
		linear-gradient(#000 0 0) bottom left / 16px 16px no-repeat,
		linear-gradient(#000 0 0) bottom right / 16px 16px no-repeat;
	mask:
		linear-gradient(#000 0 0) top left / 16px 16px no-repeat,
		linear-gradient(#000 0 0) top right / 16px 16px no-repeat,
		linear-gradient(#000 0 0) bottom left / 16px 16px no-repeat,
		linear-gradient(#000 0 0) bottom right / 16px 16px no-repeat;
}

.viewfinder::after {
	/* focus square in the center */
	inset: 42% 38%;
	border-width: 1px;
	opacity: 0.6;
}

.tile--passions.is-live .viewfinder::before {
	inset: 16px;
}

.tile--passions.is-live .viewfinder::after {
	inset: 40% 35%;
	border-color: var(--accent);
	opacity: 1;
}

.viewfinder__tag,
.viewfinder__count {
	position: absolute;
	z-index: 1;
	font-family: var(--font-mono);
	font-size: 0.65rem;
	letter-spacing: 0.06em;
	color: var(--muted);
}

.viewfinder__tag {
	left: 16px;
	bottom: 14px;
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.viewfinder__count {
	right: 16px;
	bottom: 14px;
}

.rec {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent);
	animation: blink 1.4s steps(1) infinite;
}

@keyframes blink {
	50% { opacity: 0; }
}

/* --- Contact --- */
.tile--contact {
	grid-area: contact;
	justify-content: space-between;
	background: var(--text);
	color: var(--bg);
	border-color: transparent;
}

.tile--contact .tile__label {
	color: color-mix(in srgb, var(--bg) 60%, transparent);
}

.contact__email {
	font-family: var(--font-display);
	font-size: clamp(1.2rem, 1.7vw, 1.6rem);
	letter-spacing: -0.03em;
	line-height: 1.15;
	overflow-wrap: anywhere;
	transition: color 0.2s ease;
}

.contact__email:hover {
	color: var(--accent);
}

.contact__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.6rem 1rem;
	font-size: 0.85rem;
}

.contact__copy {
	padding: 0.4rem 0.85rem;
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--bg) 30%, transparent);
	transition: background-color 0.2s ease, color 0.2s ease;
}

.contact__copy:hover {
	background: var(--bg);
	color: var(--text);
}

.contact__socials {
	display: flex;
	gap: 0.9rem;
}

.contact__socials a {
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

.contact__socials a:hover {
	opacity: 1;
}

/* ---------- Footer ---------- */
.footer {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.25rem calc(var(--gap) + 10px) 1.5rem;
	font-size: 0.8rem;
	color: var(--muted);
}

/* ---------- Panels ---------- */
/* No-JS: panels are plain stacked sections */
.panel {
	border-top: 1px solid var(--line);
}

.panel__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.5rem 0;
}

.panel__crumb {
	font-family: var(--font-mono);
	font-size: 0.74rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
}

.panel__close {
	display: none;
}

.panel__inner {
	width: min(100% - 3rem, 820px);
	margin-inline: auto;
	padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 5rem);
}

.panel--wide .panel__inner {
	width: min(100% - 3rem, 1120px);
}

.panel__title {
	font-size: clamp(2rem, 5vw, 3.6rem);
	letter-spacing: -0.04em;
	margin-bottom: 1.5rem;
	outline: none;
}

.panel__lead {
	font-size: clamp(1.15rem, 2vw, 1.45rem);
	line-height: 1.5;
	letter-spacing: -0.01em;
	margin-bottom: 1.25rem;
}

.panel__lead em {
	font-style: normal;
	color: var(--accent);
}

.panel__inner > p:not(.panel__lead):not(.pill) {
	color: var(--text);
	opacity: 0.86;
	margin-bottom: 1rem;
	max-width: 40rem;
}

.panel__inner > p.muted {
	opacity: 1;
	color: var(--muted);
}

.panel__h3 {
	font-size: 1.35rem;
	margin: 3rem 0 0.8rem;
}

/* With JS: panels open in an overlay */
.js .overlay {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: none;
	place-items: center;
	padding: 2.5vh 2vw;
}

.js .overlay.is-open {
	display: grid;
}

.overlay__backdrop {
	display: none;
}

.js .overlay__backdrop {
	display: block;
	position: absolute;
	inset: 0;
	background: color-mix(in srgb, var(--bg) 72%, transparent);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.js .panel {
	display: none;
	position: relative;
	width: min(960px, 100%);
	height: 100%;
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 1px solid var(--line-strong);
	border-radius: 28px;
	background: var(--tile);
	box-shadow: var(--shadow);
}

.js .panel--wide {
	width: min(1240px, 100%);
}

.js .panel.is-active {
	display: block;
}

.js .panel:focus-visible {
	outline: none;
}

.js .panel.anim-in {
	animation: panel-in 0.55s var(--ease);
}

@keyframes panel-in {
	from {
		opacity: 0;
		transform: translateY(24px) scale(0.97);
	}
}

.js .panel__bar {
	position: sticky;
	top: 0;
	z-index: 5;
	padding: 0.9rem 1rem 0.9rem 1.5rem;
	background: color-mix(in srgb, var(--tile) 82%, transparent);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

.js .panel__close {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--line-strong);
	font-size: 1.4rem;
	line-height: 1;
	transition: transform 0.5s var(--spring), border-color 0.2s ease;
}

.js .panel__close:hover {
	transform: rotate(90deg);
	border-color: var(--accent);
}

/* Content inside an opened panel rises in, one block at a time */
.js .panel.is-active .stagger > * {
	animation: rise 0.8s var(--ease) backwards;
	animation-delay: calc(var(--s, 0) * 60ms + 120ms);
}

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
}

/* Morph between tile and panel (View Transitions) */
::view-transition-group(morph) {
	animation-duration: 0.6s;
	animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-old(morph),
::view-transition-new(morph) {
	height: 100%;
	object-fit: cover;
	object-position: top left;
}

::view-transition-old(morph) {
	animation: vt-out 0.25s ease both;
}

::view-transition-new(morph) {
	animation: vt-in 0.35s 0.12s ease both;
}

@keyframes vt-out {
	to { opacity: 0; }
}

@keyframes vt-in {
	from { opacity: 0; }
}

/* Theme switch: circular reveal handled in JS, disable default crossfade */
:root.vt-theme::view-transition-old(root),
:root.vt-theme::view-transition-new(root) {
	animation: none;
	mix-blend-mode: normal;
}

/* ---------- About panel ---------- */
.about__hero {
	display: grid;
	grid-template-columns: clamp(160px, 24vw, 240px) 1fr;
	align-items: end;
	gap: clamp(1.25rem, 3vw, 2.25rem);
	margin-bottom: 1.75rem;
}

.about__hero .panel__title {
	margin-bottom: 0;
}

.about__photo {
	margin: 0;
	aspect-ratio: 1;
	border-radius: 22px;
	overflow: hidden;
	background: var(--bg);
	box-shadow: var(--shadow);
}

.about__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: scale 0.8s var(--ease);
}

.about__photo:hover img {
	scale: 1.04;
}

@media (max-width: 640px) {
	.about__hero {
		grid-template-columns: 1fr;
		align-items: start;
	}

	.about__photo {
		width: min(220px, 60vw);
	}
}

.langs {
	display: grid;
	gap: 0.15rem;
	margin-top: 1.25rem;
}

.langs li {
	display: grid;
	grid-template-columns: 9rem 1fr;
	grid-template-areas: "name bar" "name note";
	column-gap: 1.25rem;
	padding: 0.8rem 0;
	border-top: 1px solid var(--line);
}

.langs__name {
	grid-area: name;
	font-family: var(--font-display);
	font-size: 1.1rem;
}

.langs__bar {
	grid-area: bar;
	position: relative;
	height: 4px;
	margin-top: 0.6rem;
	border-radius: 4px;
	background: var(--line);
	overflow: hidden;
}

.langs__bar::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--accent);
	transform-origin: left;
	transform: scaleX(var(--v, 0));
}

.js .panel.is-active .langs__bar::after {
	animation: bar 1.4s var(--ease) 0.5s backwards;
}

@keyframes bar {
	from { transform: scaleX(0); }
}

.langs__note {
	grid-area: note;
	margin-top: 0.4rem;
	font-size: 0.88rem;
	color: var(--muted);
}

/* ---------- Journey panel ---------- */
.timeline {
	border-bottom: 1px solid var(--line);
}

.timeline__item {
	display: grid;
	grid-template-columns: 9rem 1fr;
	gap: 1.25rem;
	padding: 1.25rem 0;
	border-top: 1px solid var(--line);
}

.timeline__when {
	font-family: var(--font-mono);
	font-size: 0.8rem;
	color: var(--muted);
	padding-top: 0.2rem;
}

.timeline__item.is-now .timeline__when {
	color: var(--accent);
}

.timeline__item h3 {
	font-size: 1.15rem;
	margin-bottom: 0.35rem;
}

.timeline__item h3 span {
	color: var(--muted);
	font-weight: 400;
	margin-left: 0.35rem;
}

.timeline__item p {
	color: var(--muted);
	font-size: 0.95rem;
}

.skills {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
}

.skills > div {
	padding: 1.2rem;
	border-radius: 16px;
	border: 1px solid var(--line);
}

.skills h4 {
	font-size: 1rem;
	margin-bottom: 0.5rem;
	color: var(--accent);
}

.skills p {
	font-size: 0.9rem;
	color: var(--muted);
}

/* ---------- Projects panel: the deck ---------- */
.deck__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.2rem;
	margin-bottom: 2rem;
	font-size: 0.9rem;
}

.suit {
	font-weight: 400;
	margin-right: 0.2rem;
	color: var(--text);
}

.suit--h {
	color: var(--accent);
}

.deck {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 1.5rem 1.25rem;
}

.pcard {
	position: relative;
	color: var(--card-ink);
	transition: translate 0.5s var(--spring), rotate 0.5s var(--spring);
}

.pcard__face {
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: 10px;
	border-radius: 16px;
	background: var(--card);
	border: 1px solid rgba(0, 0, 0, 0.08);
	text-align: left;
}

.pcard__front {
	position: relative;
	gap: 8px;
}

.pcard__index {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: fit-content;
	font-family: var(--font-mono);
	font-size: 0.62rem;
	line-height: 1;
}

.pcard__index b {
	font-size: 1.05rem;
	font-weight: 400;
	margin-bottom: 2px;
}

.pcard--h .pcard__index b {
	color: #d6301a;
}

.pcard__art {
	position: relative;
	flex: 1;
	min-height: 0;
	border-radius: 9px;
	overflow: hidden;
	background: #1b1b22;
}

.pcard__art img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: scale 0.7s var(--ease);
}

.pcard__art--light {
	background: #fff;
}

.pcard__art--light img {
	object-fit: contain;
}

.pcard__art--logo {
	display: grid;
	place-items: center;
	background: radial-gradient(circle at 50% 40%, #2a2a35, #121218);
}

.pcard__art--logo img {
	width: 60%;
	height: auto;
	object-fit: contain;
}

.pcard__name {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	font-family: var(--font-display);
	font-weight: 500;
	font-size: 0.98rem;
	line-height: 1.2;
	padding: 2px 2px 0;
}

.pcard__badge {
	padding: 0.1rem 0.45rem;
	border-radius: 999px;
	font-family: var(--font-body);
	font-size: 0.62rem;
	font-weight: 500;
	letter-spacing: 0.03em;
	background: var(--accent);
	color: #fff;
}

.pcard__badge--alt {
	background: transparent;
	color: var(--card-ink);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.pcard__back {
	gap: 0.6rem;
	padding: 16px;
}

.pcard__meta {
	font-family: var(--font-mono);
	font-size: 0.66rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #6b6b74;
}

.pcard__back h3 {
	font-size: 1.1rem;
}

.pcard__back p {
	font-size: 0.82rem;
	line-height: 1.45;
	color: #3d3d45;
}

.pcard__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: auto;
}

.pcard__links a {
	padding: 0.3rem 0.75rem;
	border-radius: 999px;
	background: var(--card-ink);
	color: var(--card);
	font-size: 0.78rem;
	font-weight: 500;
	transition: background-color 0.2s ease;
}

.pcard__links a:hover {
	background: var(--accent);
}

.pcard__flipback {
	display: none;
	font-size: 0.75rem;
	color: #6b6b74;
	text-align: left;
}

.pcard__flipback:hover {
	color: var(--card-ink);
}

/* With JS: real two-sided cards */
.js .pcard {
	aspect-ratio: 5 / 7;
	perspective: 1200px;
}

.js .pcard__inner {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
	transition: transform 0.8s var(--spring);
}

.js .pcard__face {
	position: absolute;
	inset: 0;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	box-shadow: 0 18px 30px -18px rgba(0, 0, 0, 0.55);
}

.js .pcard__back {
	transform: rotateY(180deg);
}

.js .pcard__links {
	margin-top: auto;
}

.js .pcard__flipback {
	display: block;
}

/* Cards stay hidden until the deal animation takes over */
.js .deck.is-pending .pcard {
	opacity: 0;
}

.js .pcard.is-flipped .pcard__inner {
	transform: rotateY(180deg);
}

@media (hover: hover) {
	.js .pcard:hover {
		translate: 0 -10px;
		rotate: -1.5deg;
		z-index: 2;
	}

	.js .pcard:nth-child(even):hover {
		rotate: 1.5deg;
	}

	.js .pcard:hover .pcard__art img {
		scale: 1.06;
	}
}

/* ---------- CaliParks panel ---------- */
.pill {
	display: inline-flex;
	align-items: center;
	padding: 0.3rem 0.8rem;
	margin-bottom: 1.25rem;
	border-radius: 999px;
	border: 1px solid var(--line-strong);
	font-family: var(--font-mono);
	font-size: 0.74rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--accent);
}

.pillars {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
	margin: 2.25rem 0;
}

.pillars li {
	padding: 1.3rem;
	border-radius: 16px;
	border: 1px solid var(--line);
	transition: border-color 0.3s ease, translate 0.5s var(--spring);
}

.pillars li:hover {
	border-color: var(--accent);
	translate: 0 -4px;
}

.pillars h3 {
	font-size: 1.1rem;
	margin-bottom: 0.4rem;
}

.pillars p {
	font-size: 0.9rem;
	color: var(--muted);
}

/* ---------- Passions panel ---------- */
.hobbies {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0 2rem;
}

.hobbies li {
	padding: 1.1rem 0;
	border-top: 1px solid var(--line);
}

.hobbies h3 {
	font-size: 1.1rem;
	margin-bottom: 0.3rem;
}

.hobbies p {
	color: var(--muted);
	font-size: 0.93rem;
}

/* ---------- Toast ---------- */
.toast {
	position: fixed;
	left: 50%;
	bottom: 1.5rem;
	z-index: 300;
	padding: 0.7rem 1.2rem;
	border-radius: 999px;
	background: var(--text);
	color: var(--bg);
	font-size: 0.9rem;
	opacity: 0;
	transform: translate(-50%, 1rem);
	transition: opacity 0.3s ease, transform 0.5s var(--spring);
	pointer-events: none;
}

.toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.bento {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-template-areas:
			"intro intro"
			"journey now"
			"projects passions"
			"contact contact";
	}

	.tile--intro {
		min-height: 420px;
	}

	.tile--journey,
	.tile--now {
		min-height: 230px;
	}

	.tile--projects {
		min-height: 300px;
	}

	.tile--passions {
		flex-direction: column;
	}

	.viewfinder {
		width: 100%;
		aspect-ratio: 16 / 10;
	}
}

@media (max-width: 640px) {
	:root {
		--gap: 10px;
		--radius: 20px;
	}

	.nav__status {
		display: none;
	}

	.bento {
		grid-template-columns: 1fr;
		grid-template-areas: "intro" "journey" "projects" "now" "passions" "contact";
	}

	.tile--intro {
		min-height: 0;
	}

	.tile--projects {
		min-height: 300px;
	}

	.fan {
		min-height: 210px;
	}

	.network {
		max-height: 110px;
	}

	.viewfinder {
		aspect-ratio: 4 / 3;
	}

	.js .overlay {
		padding: 0;
	}

	.js .panel {
		border-radius: 0;
		border: 0;
	}

	.langs li,
	.timeline__item {
		grid-template-columns: 1fr;
		grid-template-areas: "name" "bar" "note";
		gap: 0.3rem;
	}

	.skills,
	.pillars,
	.hobbies {
		grid-template-columns: 1fr;
	}


	.deck {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.9rem;
	}

	.pcard__back p {
		font-size: 0.76rem;
	}
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		animation-delay: 0s !important;
	}

	.js .tile {
		opacity: 1;
		translate: none;
	}
}
